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 
@kbrock  Why add the "0.0.0.0"?