Expand hints for getAddrInfo. More exception safety.

Without address family / socket type hints, it can happen that the first `AddrInfo` returned is a `Datagram` socket. Also added some more exception-safety.