Fix bind_sockets if OS does not support IPv6

Python could be compiled with IPv6 support but the host OS does not support IPv6. In this case `socket.getaddrinfo` returns still IPv6 addresses and a call to `socket.socket(socket.AF_INET6)` raises EAFNOSUPPORT.