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.
Merge pull request #1389 from opscode/lcg/fix-configure-hostname

CHEF-5211: fix configure hostname guessing