Fix critical problems with quitting

This branch improves the behavior of ImageJ when quitting in various scenarios.

Most importantly, it is intended to fix the problem where the ImageJ process does not terminate when the user expects it to do so. ImageJ1 calls `System.exit(0);` in some circumstances, which means that several plugins and even parts of ImageJ1 core (e.g., `ContrastAdjuster`) depend on that behavior and do not clean up after themselves to ensure a clean shutdown. So let's make sure that the legacy user interface still calls `System.exit(0);` in those same circumstances.

As an extra bonus, the branch improves the behavior of `WindowManager.closeAllWindows()` to prompt the user to save their changes in more situations.

See commit messages below for further details.