Discard changes made in the dialog and close the dialog.