Fix a NULL deref when getting an actual result for an invalid hostname
in gethostbyname().  Similar fix for getnetbyname().

ok deraadt@ daniel@ jca@