CP-9795: Improve comparison of hostname against localhost

On RHEL-based systems prior to 7, the output of hostname with no
hostname setup is "localhost.localdomain".  On RHEL 7-based systems and
Debian-based systems, the output of hostname is "localhost".  Compare
the name label against either of these values for resilience.

Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>