Improve performance reading from network.

data_thread reads XML 1023 bytes at a time, which is silly and
inefficient. Instead, create a buffer that doubles in size as necessary
and has a more reasonable initial buffer size.

When we get gzip content, start with a buffer size larger than our
gzipped contents, since we will probably need that anyway.
Merge pull request #128 from dhobsd/dho/network-performance

Improve performance reading from network.