properly detect localhost

a blank hostname means localhost

Good news: we have already fixed that in most places.

This is blocking upgrading the appliance from the ui

 https://bugzilla.redhat.com/show_bug.cgi?id=1050211

/cc @brandondunne 
"0.0.0.0" usually stands for "any IPv4-host at all", "any IPv4-interface at all" or "default route"