net/http: buffer before chunking

This introduces a buffer between writing from a handler and
writing chunks.  Further, it delays writing the header until
the first full chunk is ready.  In the case where the first
full chunk is also the final chunk (for small responses), that
means we can also compute a Content-Length, which is a nice
side effect for certain benchmarks.

Fixes issue 2357

R=golang-dev, dave, minux.ma, rsc, adg, balasanjay
CC=golang-dev
https://codereview.appspot.com/6964043