Fixes memory leak when using reflection

References to Threads would be retained long after their termination if
reflection is used in them. This led to a steady, long memory leak in
applications using reflection in thread pools.

Closes https://issues.scala-lang.org/browse/SI-8946

Mentioning @retronym @xeno-by