Prevent theoretical double free and leak on get_peer_sock_name.