Fix bind_sockets if OS does not support IPv6
Merge branch 'master' into python23