Handle ValueError exception that can be thrown by inet_pton in windows

When trying to run OpenBazaar in windows, a `ValueError` exception is thrown every time `socket.inet_pton` is called with 'socket.AF_INET6' parameter. This commit adds a handler for `ValueError`. The syntax in the affected lines is altered to be forward-compatible with Python 3