net.c: Combine host_and_port() and __get_sock_name().