Fixed crash when using IPv6 addresses

Ok, I'm retarded. struct sockaddr is not big enough to hold struct
sockaddr_in6, so we were writing out of boundaries. Use struct
sockaddr_storage instead.