Autotest: Fixed a race condition in the network self test.
Autotest: Fixed a race condition in the network self test.

Some of the tests (including the httpsServer one) requested that the
server close the connection (Connection: close). It could happen that,
well, the server did close the connection and we noticed it while doing
the waitForBytesWritten in the doSocketFlush function. Then we'd create
an error in the next step because the socket wasn't connected.

Reviewed-by: TrustMe
(cherry picked from commit 95ceabf52d79b922a87f7c023c9606e633ab1ea2)

igor-sfdc/qt-wk,radekp/qt,pruiz/wkhtmltopdf-qt,pruiz/wkhtmltopdf-qt,RLovelett/qt,igor-sfdc/qt-wk,RLovelett/qt,pruiz/wkhtmltopdf-qt,KDE/qt,KDE/qt,igor-sfdc/qt-wk,radekp/qt,pruiz/wkhtmltopdf-qt,RLovelett/qt,igor-sfdc/qt-wk,pruiz/wkhtmltopdf-qt,pruiz/wkhtmltopdf-qt,radekp/qt,RLovelett/qt,KDE/qt,KDE/qt,RLovelett/qt,pruiz/wkhtmltopdf-qt,RLovelett/qt,igor-sfdc/qt-wk,RLovelett/qt,igor-sfdc/qt-wk,igor-sfdc/qt-wk,pruiz/wkhtmltopdf-qt,KDE/qt,pruiz/wkhtmltopdf-qt,pruiz/wkhtmltopdf-qt,radekp/qt,radekp/qt,KDE/qt,radekp/qt,radekp/qt,RLovelett/qt,igor-sfdc/qt-wk,RLovelett/qt,RLovelett/qt,radekp/qt,radekp/qt,RLovelett/qt,igor-sfdc/qt-wk,igor-sfdc/qt-wk,KDE/qt,KDE/qt,pruiz/wkhtmltopdf-qt,igor-sfdc/qt-wk,radekp/qt