Deprecate then Remove `-ddump-json`
This is an issue to track the deprecation and removal of the `-ddump-json` flag, which is being replaced by the `-fdiagnostics-as-json` flag. Details of the discussion can be found at #19278.
Tasks:
Any code that uses `MCDiagnostic` (directly or via `mkMCDiagnostic` or `errorDiagnostic`) side steps `-fdiagnostics-as-json`. To address this:
1. [x] Refactor all places in the compiler that report diagnostics to use `printMessages` / `reportError` / `reportDiagnostic` from `GHC.Driver.Errors`.
2. [x] Get rid of `errorDiagnostic`
3. [x] Rename `mkMCDiagnostic` to `unsafeMCDiagnostic`
4. [x] Hide `MCDiagnostic`
5. [ ] Remove `-ddump-json`
6. [ ] Get rid of `jsonLogAction`
7. [ ] Consolidate diagnostics handling somehow, either in `printMessages` or `defaultLogActionWithHandles`
issue