Rewrote buffer growth strategy
It is now 1.625x old size instead of 2.0 x old size + bytes_added,
with some exception.
Also added a shrink strategy, by default it's close to the reverse: If
more than 61.5% of the buffer is empty space, shrink it down
(cherry picked from commit 917184b64444098f8b84c79cdd1de89ccaa467f6)