LegacyHooks#quit(): improve javadoc

This clarifies the purpose of the method, and provides a link back to
the method being hooked.
Introduce a hook called just before IJ1 disposal

This hook is called after ImageJ1 has already done all its checks and
confirmed that indeed it is going to dispose itself and quit, but before
it has actually done so.

The LegacyHooks#disposing() method can now been overridden to control
exactly what happens before ImageJ1 disposes of itself and quits.

As currently written, there is one small wrinkle: ImageJ1 actually saves
its preferences _before_ this hook is triggered, meaning that even if
the disposal is canceled at this point, preferences will still have been
updated. This was done mostly for pragmatic reasons, and could be fixed
later if needed with some effort in the CodeHacker.

Thanks to Johannes Schindelin for the invaluable pair programming!
EssentialLegacyHooks: fix javadoc link and style
LegacyHooks#getContext(): tweak javadoc