use proper cache for gids

This fixes a bug where the incorrect uid was returned when user_name==group_name. The first time uidNumber() was called, the values passed to the callback were correct. However, for all subsequent calls (with the same arguments), the gid was returned in place of the uid.