Add possibility to pass own DiagnosticsCollector to the
JavaSourceCompiler.compile() method.

This allows manual handling of compilation errors, for example to
display them in a user interface or custom log.