Only return ipv4 addresses

Previously, it was possible that get_ip_of_node
might return an ipv6 address. I found that this
caused failures so this patch adds a check that
will try to return the first non-private ipv4
address.