Modify end of Socket.gethostbyname to also convert IPv6 addresses into
packed strings. This code is taken from IPAddr#hton.