[DB-7762] SessionFactoryImpl memory leak fix