Do not time out for -1 msec (wait methods)

According to the documentation of QIODevice:

* http://qt-project.org/doc/qt-5.1/qtcore/qiodevice.html#waitForBytesWritten

* http://qt-project.org/doc/qt-5.1/qtcore/qiodevice.html#waitForReadyRead

these wait methods should not time out if msecs is -1.

Currently, the behavior does not match the expected behavior as the
negative values were overridden by zero. The operation returns as
soon as the event loop processing happens.

Now this problem is solved for Windows: the INFINITE flag has been
added to the WaitForMultipleObjects call. See the MSDN documentation
for details below:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms687025%28v=vs.85%29.aspx

Note: the check is added only for -1 to be consistent with the behavior
of other QIODevice subclasses. If it is any other negative integer, the
value will be cast to the corresponding positive value which will
indicate the waiting time.

Tested with Qt4 and then Qt5.

Change-Id: I2b8c8310723bca7beb9af0213edf4c855b5ac6ae
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>