Fix a bug in grow_stgbuffer() not updating staging buffer size

The grow_stgbuffer() function, which grows the staging buffer, was
not updating the buffer size after reallocating the buffer itself.
This caused lots of reallocations because stgwrite() calls this
function for every character (!).

This also decreases compile times by ~20% (from 10s down to 8s in
my setup).
More optimal array growth factor

http://stackoverflow.com/questions/1100311/what-is-the-ideal-growth-rate-for-a-dynamically-allocated-array