Added detection of leaking ResultSets and fixed a minor leak when
loading groups from the database.