Instead of complicated capacity estimation, just use thread local buffers.

Fixes #1951