Fix AtomicWriter race condition on Windows