Use GLib's portable version gethostname(): g_get_host_name()

Drop our own portability layer and use GLib's one instead (which
actually does exactly the same as our own).

Thanks to Matthew for spotting this.