In general, keeping the lock *for* a copy is a problem, as it can serve as a contention point. Also, whoever appends data calls process() that eventually triggers this callback (through curl_multi_perform()).

The reason for having the lock to start with is that we're going through a control flow of external library, and I don't want to rely on its internal implementation for threading. I'm not sure this lock is actually needed, as it is possible (and more than likely) that libcurl does everything single threaded. But as I said, I don't want to rely on that.