JBTHR-28 Ensure listener is called when there are running threads during...

... shutdown

This is an alternative for https://github.com/jbossas/jboss-threads/pull/9, done in the same way as https://github.com/jbossas/jboss-threads/pull/8 to invoke the listener outside the lock.