Fix hang when entering wrong sudo pw

Task-number: QTIFW-451
Task-number: QTIFW-409
Change-Id: I83ebd338b5f52f2a0b3b1fabcce8fb98afce5e19
Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>