This replaces the current implementation with `json.MarshalIndent` which doesn't produce the same output, but at least it doesn't crash.
There's a bug in the upstream `litter` library. This can probably be fixed, but that needs to wait.
I have tested `go-spew` which does not crash, but it is very data racy in this context.
FIxes#12309