iosdevice: guard detection handlers against foreign exceptions

Change-Id: I1f74aff3aa68cf8334ede232af61c85f3152adb9
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
iostoolhandler: thighten stop process

gurantee that finished is emitted also when the process fails to start
and always after the sub process has actually finished.

Change-Id: I716ebf62074dc77790716e60e88348a932cbe9f6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>