Fix caching of group members

I have found a bug concerning the caching of group members. When adding UIDs to the cache, each entry is written to the cache once, but the UID counter is incremented *twice*, leaving blank records between the UIDs in the cache. Also, the data is thus written ahead of where it should be and entries from following groups partially overwrite entries from the groups that were processed before.

The commit in this pull request fixes the double counting.