Do not continue waitForReadyRead() if an error occurred

This patch improves workaround implemented in the previous commit
d34fce4a5d12789ded107631e22cb6ef54d35eee

Change-Id: I013b19b47ee343ab00f242d7ee1021b92c07d18f
Reviewed-by: Peter Kümmel <syntheticpp@gmx.net>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>