Added "provided" scope to hibernate and postgresql plugins
Added back the check to see if the Hibernate Session isOpen() before closing the EntityManager