Avoid a NullPointerException when ij.ImageJ#dispose() is called twice

Of course, it should not be called twice. But then, we should not use
unchecked values either.

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