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 
BTW, I actually think the `nil, "", ...` way looks cleaner.