move post-flush logic to bg thread to retain parity with earlier version