Prevent nested synchronize calls on different nodes from affecting each other

This should prevent race conditions when calls to `synchronize` are nested.