test: monitor: dump json stat into file if json decoder failed
test: write_cas: do not use lambda, use plain function instead (checking RHEL6 issue)