Optimize of writing sequence algorithm


* The writeSequenceStarted shall be set to true after a successful call
of WriteFile() and to be dropped to false in case of write completion.

* The method startAsyncWrite() shall not call WriteFile() if the
writeBuffer is empty or writing sequence is already started. Also now
there is no sense to check a validity of pointers on data in writeBuffer
before call of WriteFile() because writeBuffer can not be empty.

* It is also expedient to free the writeBuffer in _q_completeAsyncWrite()
method only if numberOfBytesTransferred is not zero.

Tested on Windows 8 with the on-board and the USB (PL2303) serial ports.

Change-Id: Ib70276705fcc3f2396bf7dd6cf6977b62382a64b
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
commit1824ad0a6e97e293098c94a038abd7b2343bf572
parentdf6baa1de99a65dd23586cb2fb308c3a24dd198e
authorDenis Shienkov <denis.shienkov@gmail.com>
committerThe Qt Project <gerrit-noreply@qt-project.org>
commit timeSun, 2 Feb 2014 10:34:54 +0100