Check whether a scripting engine is available only on demand. On Mac OS, checking for a scripting engine loads AppleScriptEngineFactory, which loads the AWT toolkit. Not pleasant, because we'd prefer Mondrian to run headless even if we don't specify java.awt.headless=true. This fix works around that problem.