[CE/SP] close site on shutdown before flushing GitOrigin-RevId: e36c80f2f4c6f10eda3a536319a2fcc5dfda4fa4