SI-6123: -explaintypes should not explain errors which won't be reported

-explainTypes means that only type tests which *fail* should be reported in more
detail by using explainTypes. Hence, callers of explainTypes should check if
type errors are being ignored, by checking context.reportErrors. Hence, this
check is added to Inferencer, and another call site is redirected to that
method.

Moreover, explainTypes should only be called if an error exists. Enforce that in
checkSubType, and remove spurious home-made explainTypes output.

Finally, in ContextErrors, stop checking `settings.explaintypes.value` before
calling `explainTypes` which will check it again.

Note that this patch does not fix all occurrences, but only the ones which
showed up during debugging. The other ones never cause problems, maybe because
they occur when contextErrors is in fact guaranteed to be true. We might want to
fix those ones anyway.

This fixes regressions in c800d1fec5241ed8c29e5af30465856f9b583246 and
78f9ef3906c78413ff8835fdad3849bfe5516be2.

Thanks to hubertp (Hubert Plociniczak) for the first round of review.

Refs #6123
backport to _2.10.x_
Add positive and negative testcases for SI-6123 (-explaintypes)

Positive testcases compile reduced known offenders to verify that no output is
produced.

The negative testcase tests that -explaintypes actually produces output on code which fails
to compile. I have altered an existing testcase, `test/files/neg/abstract`,
adding -explaintypes to the flags.

This testcase is currently mostly ineffective, as partest currently ignores the
standard output (SI-7003). It will become more effective when SI-7003 is fixed.
But already now, testers would at least be able to notice extraneous output.

This argument is somewhat bogus, but this patch is no worse than the other ones
which are committed while SI-7003 is open.
Bypass determination of protection domain when resource is not in a jar
The script engine is given a better binding mechanism and reflexive access

Better binding mecanism : formerly done through the default SimpleBindings
shipped with the API, it now goes through a custom IBindings class
which uses the bind method of the interpreter instead of simply
making the bindings available as a Map.

Reflexive access : the script engine is made available to itself
through a bound variable "engine" of type javax.script.ScriptEngine.
This will allow "variable injection" i.e. programmatic redefinition
of variables, among others.
Merge pull request #2259 from Blaisorblade/issue/6123-try-3

SI-6123: -explaintypes should not explain errors which won't be reported, new attempt
SI-5717 error when bytecode cannot be written

If there's an existing file foo when emitting a class file for foo.Bar,
then emit an error at foo.Bar, similar to what javac does.

The error message looks something like:

foo.scala:4: error: error writing object Foo: ./mypkg/Foo.class: ./mypkg is not a directory
Merge pull request #2260 from som-snytt/issue/5717-assert-pkgdir

SI-5717 error when bytecode cannot be written
Merge pull request #2265 from rjolly/scripting9

script engine : better binding mechanism + reflexive access through bound variable "engine"