Defend against bad data from gethostbyaddr(). Fixes bug #619