Checkpoint all dirty pages: don't try to figure out which ones have already been written at the checkpoint's snapshot.  Use a read-committed transaction to flush dirty pages before the real checkpoint starts.