Avoid double-dialog wars

The EXIT trap handler was also invoked when the
spinner got killed, which caused and erronous (duplicate)
dialog window.
Ignore errors before sanity checks

Avoid that the generic error handler triggers
when we're just outputting general debug information.
Merge pull request #1839 from dirkmueller/dialog_handler

Fix various issues with dialog usage