Add missing cast to getsockname.