curl json: Fix checking the response code.