http: fix segfault in handle_curl_result