Fix memberOf detection. Fixes: #9835

Proposed change.
var name is not excatly correct, because $groupdns is not just holding the DN but everything we get.
Please change $groups to $groupNames and $groupdns to $groupEntries