QPID-6007: Test if hostname is valid; if not, default to trying localhost; this is a patch from Ernie Allen

git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1623871 13f79535-47bb-0310-9956-ffa450edef68