Add support ipv6only to wait_for

Use a function socket.create_connection instead of socket.connect().