Consider primary groups when reading group members

The pw_passwd should be memset to zero like elsewhere.