Large performance optimization

With this patch, CPU usage is greatly reduced to run WAL-E.  Per some
user reports, the CPU usage was high enough to be a bottleneck in
practical use.

This is done largely by adjusting buffering all around.