CHEF-5211: fix configure hostname guessing

ohai[:fqdn] depends on DNS and may be nil.  change the algorithm to use
the hostnaome of the machine as a fallback using the same algorithm
that Chef::Client uses for guessing the node_name of a host.