net: rework autoSelectFamily implementation
This PR reworks the implementation of autoSelectFamily
in net.connect
to better swap internal TCPWrap when the connection is successful. It also fixes several issues with TLS.
It also add a global getter and setter setDefaultAutoSelectFamilyAttemptTimeout
and getDefaultAutoSelectFamilyAttemptTimeout
to allow global customization of the entire family autoselection algorithm.
Fixes #46669 (closed). Fixes #46679 (closed).