Only stop json/log if it was used
Fix running with -x leaking through mangle_stderr() and causing a crash