LegacyHooks: fix javadoc terminology

LegacyHooks was originally envisioned as an interface, but to ensure
backwards compatibility, was ultimately chosen to be an abstract base
class instead. That way, concrete subclasses will still be binary
compatible with the class even if new (concrete) methods are added.
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!