Use std::ostream to print the output from curl

With these changes all output from libcurl gets redirected to a custom function. With normal curl_easy initialization output goes to std::cout, but you can pass any std::ostream to the constructor and libcurl's output will be sent there instead.

I'm not convinced this is the right place to write this code, but it certainly facilitates the process of getting the output in a memory buffer or sent to a file directly. Maybe a free function would be a better place, but I'm not sure what happens if you set the custom function and buffer twice (they overwrite the last values set and just work?)