remove thread from thread group on termination

In the OpenJDK library, ThreadGroup maintains an array of all Threads
in that group, so the VM must explicitly remove threads as they exit
or else neither they nor any objects they reference will be eligable
for GC.
avoid allocating a new gen2 heap larger than the available heap capacity