Fix potential deadlock in Ctrl-C handling.

The current code calls into the Qt event system from the interrupt
handler, which will lead to a deadlock if the interrupt came in during
event handling. Change to an approach that does only minimal work in the
interrupt handler.

Change-Id: Ic4e615939305390efd819b47fa02c7fadb6acf16
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>