tests/common: make call to `host_name_for` idempotent
tests/common: make call to `host_name_for` idempotent

This fixes an issue on macOS/bsd where multiple calls
to `host_name_for` each added a prefix 'g'.
The issue led to some tests being skipped because `util_name` was
renamed to e.g. "ggid" instead of "gid".

uutils/coreutils,uutils/coreutils,uutils/coreutils