Fix for "localhost" problem reported on the mailing list on 17 June.

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