WFLY-2195 add defensive check if EntityManagerFactory was already closed

This (along with Hibernate changes) helps pass the entityManagerFactoryCloseExceptions tck test.