Factor out invocation of Closure compiler for Scala.js.

Using the same file system-independent mechanism, so that
it will be usable with virtual files.