Restore clean shutdown of EJB components

replaces https://github.com/wildfly/wildfly/pull/6625