Add confirm exit dialog

Add a dialog that appears if there are unsaved changes.