This commit changes send buffers allocation strategy for stream based transports. Before that change we would allocate a dynamic buffers sized at 64Kb even when we do not need that much. That could lead to high memory usage on server. Now we resize the send buffer to match the size of the actual data, freeing the memory at the end of the buffer for being reused later.
(cherry picked from commit d8a5feb5)
Closes #4038 (closed)
Backport of MR !8004 (merged)