Handle interleaved writes.

Since the streambuf instance will be invalidated by anything written to
it while it's being sent using an async call we need to use multiple
streambuf instances.