Fix memory leak in cURL transport