Added #at_exit hooks to Java thread pools.