Enhancement: Format exit errors as JSON when requested

Restic now formats error messages as JSON when the `--json` flag is used.

https://github.com/restic/restic/issues/4948
https://github.com/restic/restic/pull/4952
