Fix the flush regression on Unix


Currently, flushing is not flushing the buffer to the device because
it is calling the wrong function.

Before flush() is invoked startAsyncWrite, but this did not flush the buffer
when it was not empty. The only possible way to fix this is by invoking the
function completeAsyncWrite, it first checks for pending information in the
buffer for sending and then invokes startAsyncWrite if necessary.

The following change caused the regression: 21f5049

Test Environment: Qt 5.3.0-beta1 and Qt 4.8.2.
S.O.: 3.12.6-2kali1 i686 GNU/Linux.
Fiscal Machine: SRP350 Bixolon.
USB Adapter Serial Port: CH341
Task-number: QTBUG-38339
Change-Id: I5159b48f073d537a396b65484fcc2c3d37e4908c
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
commitfd58ceecf8a61e44392c73ec5bbdd276fe0ddce8
parent0a48b67b9b79edebaf137f34dabf9a53295ab293
authorKijam Lopez <kijamve@gmail.com>
committerThe Qt Project <gerrit-noreply@qt-project.org>
commit timeWed, 23 Apr 2014 10:44:11 +0200