The file_no of the socket IO can change while connecting.
This can happen when alternative hosts are tried,
while GSS authentication
and when falling back to unencrypted in sslmode:prefer .
Therefore expire the socket IO at each connect_poll and reset_poll call.
Caching the IO previosly led to occasional errors kind of:
Errno::EBADF: Bad file descriptor
With the recreation of an IO object per connect_poll the fileno can change in the TcpGateScheduler when running on Windows.
I didn't dig deeper why this happens, but it fails in spec
"with a Fiber scheduler connects several times concurrently"
and sometimes in other specs.