Major updates to the http backend.
* Now supports HTTP/1.1 persistent connections with pipelining. This speeds up chain enumeration on large files by almost a factor of 2 over http, and by roughly a factor of 4 over https. The difference between http and https is now much smaller. * Add timeouts to all the socket I/O. * Estimate the number of available bytes to read and use it when making connection re-use decisions. * Add support for https with proxies using HTTP/1.1 CONNECT tunnels. * Fix TLS session re-use (it requires clean shutdown). * Various other code re-organization and minor improvements.