json: a minor performance fix

avoid useless std::string copies