fix tcp and tls connect() for slow tcp connection (detected with ipv6/linux only?)