Plugged the leak in readGroupNames method.

It was leaking a resource per group, as witnessed with the tests. Plugged the leak.