security/pam-modules: redo previously committed incorrect build "fix"
The xgetname() function expecting `int (*)(char *, size_t)' was written
for gethostname() which matches this (per POSIX), but also used against
getdomainname() which does not (its `namelen' argument is int). Rather
than forcibly feeding non-matching function, create a thin wrapper with
correct types.
Fixes: 3a86f14adefa