Add and expose fr_getgid().  Addresses #776

The current users of getgwnam() don't need the entire group
structure.  They just need the gid.  So we create a function
which returns that.
Use new fr_getgid() function.  Addresses #776
Use ralloc'd memory for getgrnam_r().  Closes #776