Set the error in the same method where the check against failure is done
Set the error in the same method where the check against failure is done

This is done for consistency with other QIODevice subclasses, like in QtNetwork.
It also makes the code shorter due to the eliminated unnecessary Q_Q macro
usage.

Change-Id: Ibbd2be08e7aeff2bd0687d542cb256efb05f59bc
Reviewed-by: Denis Shienkov <6a9c747bd2ba446682324cf340d3b86f30cf4d55@gmail.com>
Reviewed-by: Sergey Belyashov <8871b4c2d635fca691211507eadbac3d0bc2695a@gmail.com>

RoadWorksSoftware/QtSerialPort-OS2,kobolabs/qtserialport,RoadWorksSoftware/QtSerialPort-OS2,kobolabs/qtserialport