Fix abuse of QProcess::error

It's invalid to call it if no previous function returned an error. Don't
rely on undefined behavior. Instead, simply check if waitForFinished()
returned false, which is what this code intended to do anyway.

Change-Id: I67903ba65e86ff1d1810481b2bd5724ab99a4b76
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
Reviewed-by: Daniel Teske <daniel.teske@digia.com>