curl_json plugin: Restore struct when handling error.