ij-legacy: Port fiji-compat's patch to ij.macro.Functions#call()

Sometimes, changes are not accepted into ImageJ 1.x' classes even if
contributed by the person who contributed the code in question.

This is the case, for example, for the call() handling in the macro
interpreter: its handler for InvocationTargetExceptions still uses
non-DRY code rather than handing off to IJ.handleException().

Usually, repeated code is just ugly and hard to maintain. In this case,
it is also a bug: if IJ.setExceptionHandler() is used to install
a different exception handler than ImageJ 1.x' default one, the macro
interpreter will still insist on doing its own exception handling.

That does not show up in standard ImageJ 1.x workflows, of course,
because they rarely entail a call to IJ.setExceptionHandler().

As long as ImageJ 1.x carries that bug, we must carry this bug fix
in ij-legacy.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
ij-legacy: allow more fine-grained code patching

The newly-introduced method allows to restrict the code patching to
one specific call.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Introduce CodeHacker#hasField(String fieldName)

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
ij-legacy: add "Convert to 8-bit Grayscale" to File>Import>Image Sequence

Ported over from fiji-compat: some Fiji users needed that option back,
but core ImageJ 1.x did not add it back.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
ij-legacy: make sure no dialog is opened in headless mode

Ported over from fiji-legacy.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>