Add double check sync in SessionFactory creation