Dismiss dialogs before upon exiting the app