[server][SessionManager] Add a workaround the problem that causes a crash.

The problem may happen when SessionManager::reset() is called
with leaked session instances. Currently reset() is called only
from the test.