HHH-8586 Synchronization beforeCompletion/afterCompletion should check if EM is closed and this helps us pass the tck entityManagerFactoryCloseExceptions test.