fix race in resync_with_write_load
Merge remote-tracking branch 'upstream/master'