The internal thread handles were cleared prematurely when attempting to join them. The handles should be also cleared when trying to kill already exited threads.