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