sync: Fix race condition between merge and signal