Cherry-Picked  Frank Cornelis' digest patch for curl_json.