Calling pipeWriter->checkForWrite() can indirectly close the socket
even if the bytesWritten() signal has not been sent. So, we need to
make sure the handle is valid before checking pipe state in the
reader.
There is no harm in calling PeekNamedPipe() with an invalid handle,
but the wrong call should be avoided.
This patch amends b2c3b3e8fe.
Change-Id: I5d2ecbbbe0af817aac68ad6f1173b0ed9b324e98
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>