[server][DataStoreManager] Fix a potential problem that has a dangling pointer.