Refactor code in connection.py

### Motivation
Refactor code in `node/connection.py` so that it is easier to read and test.

### Changelog
* Rewrite methods to bring failure cases in front and avoid multiple nested `if` and `try` statements.
* Optimization: Delay data compression in `PeerConnection.send_raw` until we are sure we'll send them.
* Strip `try-except` from `PeerConnection.create_zmq_socket`; caller already handles exceptions.
* Refactor and DRY `CryptoPeerConnection.check_port`.
  * Prefer ipv6 over ipv4 sockets.
  * Create sockets inside `with` to ensure they are closed upon termination.
* Some other minor style changes.
The only thing I would be hesitant to remove it for is that we may want to configure additional settings on the socket. For instance, there may at some time be hooks into proxies (i.e. Tor integration). I'm fine for removing it for now though since there really is no added value at the moment.