sockets: add helpers for creating SocketAddress from a socket