(#17811) Fix group id conversion for OS X users

On OS X, the primary group for a user must be specified as a numeric id and not
a string. There is code to ensure this happens, but it is guarded by a faulty
logic statement and there is no test to catch the bug.

ref [#17811](https://projects.puppetlabs.com/issues/17811).