gid_from_group and uid_from_user on Darwin. Fix (lightly modified by myself) submitted by Aleksej Lebedev in PR#50440.