Ensure 0 < port < 65535

This PR makes sure we only connect to a node if the port range is between `1-65536`.
We need to do this since bad nodes in the dht sometimes send invalid ports.