GUI: save dialog on closing unsaved tab, scratch editor removed