Fix some potential race conditions in RemoteStoreManager