Fix premature curl_close()