make the gtk_main loop robust against errors (esp. ^C)