Cap the data that we buffer in memory for a stream.

This sets the maximum on the amount of memory we can allocate, so
we don't consume all system memory in extreme cases (very large mysql
responses) or when we misinterpret the protocol.