Revert the private qtcore_unix related changes because they break the Qt 4 build

Revert "Open file descriptors thread-safely on Unix and don't leak them"

This reverts commit 691212d9e492b12590d5b7f4e2b24921911d4b17.

Revert "Protect against EINTR in Unix non-atomic I/O calls"

This reverts commit a8597cbae47076e33b638c2e593f852c8c0a02d5.

Change-Id: I6d931ae6d3b4bee9be019fdf4a08ecc5a41a2b0f
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Do not emit bytesWritten() while data aren't transferred

The serial port very slow device therefore the system
call write() doesn't guarantee that data were transferred
completely to the device. It guarantee only that data were
sent to the driver from the user space.

Thus it is wrong to emit the bytesWritten() signal at once
after successful writing.

The correct solution is to store the number of transferred
data in some variable (e.g. pendingBytesWritten in this
case) and to wait for the next notification from the
WriteNotifier that the write FIFO of device is empty (i.e.
when all data were really transferred) and ready to
transmission of the next portion of data.

Also good decision is to divide a data transfer operation
into two methods: startAsyncWrite() and completeAsyncWrite(),
similar with the Windows implementation.

Where the startAsyncWrite() invokes the write() system
call, and the completeAsyncWrite() is invoked by a
writeNotifier to complete writing operation or start a new
startAsyncWrite() operation.

Tested on Arch Linux 64 bit with the on-board and the USB
(PL2303) serial ports with use Qt4 and then Qt5.

Change-Id: I1c274b2052a9bd54811586c6f1cfdf080b400263
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Merge remote-tracking branch 'origin/stable' into dev

Change-Id: I111ca7fd67979152329f290d45bd5b47551a404a