LegacyExtensions: allow early open returns

If the openImage signatures receive an Object from the LegacyHooks, if
that Object is not an ImagePlus then we will short-circuit and return
null immediately.

This will allow us to properly cancel dialogs in the legacy UI without
then popping the IJ open file dialog.