fix #3570: crash when dismissing a progress dialog

This crash should never happen if we handled lifecycles more correctly.
But to avoid penalizing users in the meantime, this temporary fix will
allow the application to go on.