utils: add support for passings address family to network_get_endpoint()