After editing a file and pressing cancel, ask for saving the image instead of waiting for closing the global window.
