qtest.py: Wait for the result of qtest commands