Handle localhost or 127.0.0.1 as the hostname of the XML-RPC server

Needed for systems where the hostname does not resolve to an
interface address where a socket can be created. This can happen
when the machine is not connected to any network, or where the
hostname is not set or available by DHCP