Curl: add a thread for http downloads
The thread uses pooling to keep CPU usage low. I've seen 2MB download speed over my 4G connection.
I'm not sure why, but this can bork the loading screen progress bar.
There's really no need to use a thread. I found a perfect place to call CL_WWWDownload - in Com_Frame, if you set a really low framerate then the main thread wakes up every 50 ms and pumps the event loop (here). So by invoking the download loop there we could avoid any problems caused by setting a low framerate when minimized.
To get rid of the thread-safety problem this version has, I can make DL_DownloadStatus return the progress (return a struct that contains {status, count, max}) and get rid of the cvars. I think it's a bit better to have this in a thread and to get rid of the cvars.