SwingDialog: dispose dialogs after dismissal

Otherwise, ImageJ won't shut down properly later.