Avoid deprecated `error` in CompilationUnit.

`unit.reporter` simply forwards to `global.reporter`,
so use that one instead. Use `typer.context.error`
where silent mode should be respected (i.e., during type checking).