Add a public API to write a .jar file with the patched classes

This adds the support for writing [`misc/headless.jar`](http://fiji.sc/Headless) back; It was lost in the move from ij-legacy.