Make platforms Disposable

This allows platforms to clean up after themselves as needed when ImageJ
is shut down.
MacOSXPlatform: first attempt at resource disposal

It does not fully work, but documents a FIXME where the problem lies.