nativeConnect calls WSAConnect, tests its return value and then in case of SOCKET_ERROR
checks WSAGetLastError and calls getsockopt to extract SO_ERROR. While MSDN
says that getsockopt should clear the error, it's not true and this error can later affect in some
weird way the next WSAConnect attempt/or nativeConnect's logic.
Found in tst_qtcpsocket::bindThenResolveHost failing in this scenario: QHostInfo
has a list of invalid/valid addresses,
and as a result test doing strange things in waitForConnected and failing (and sometimes
passing).
Task-number: QTBUG-49255
Change-Id: I71f771647f305d8ca327d25ac7382a2edab96d17
Reviewed-by: Richard J. Moore <rich@kde.org>