Properly wait for stdout in test

Assuming all output is available on the first readyReadStandardOutput()
signal leads to flaky test results.

Change-Id: I442d7edc905abc067d6c32a4a55afd42ed03e3c9
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>