Release unused local references when querying thread name

The JVMTI documentation mentions that these references
(thread_group and context_class_loader) should be managed,
so we call JNI->DeleteLocalRef() on them.
2 jobs from devel in 2 minutes and 55 seconds (queued for 2 seconds)
Status Job ID Name Coverage
  Build
passed #8369
build

00:00:35

 
  Test
passed #8370
test

00:02:19