Fix cookbook crash if a node is missing a hostname

There are cases where ohai cannot determine a fqdn for a node (like if
dns is not working) and node['hostname'] can be nil.  This deals with
that situation by returning the node name in place of the hostname if
node['hostname'] is nil.