Fix race condition during shutdown causing a NPE.

From the getThreadGroup() Javadoc:
	Returns the thread group to which this thread belongs.
	This method returns null if this thread has died (been stopped).
Merge branch 'cleanup-fix-v1.1.3' into maint-v1.1.3
v1.1.3.2 fixing shutdown NPE