store: fix race in watcher_hub

Get the lock before modifing the global objects in the hub.