Fix --json tests

For #865.

Still working on reproducing the `conda clean` failure.