curl_json plugin: Improve error handling.