Json::pretty_print should do strlen only if it needs to