Fixed bug #478 to correctly reallocate buffer
Created by: williamfgc
Caused when reallocating metadata in data. Capacity was sufficient, while size was not. Enforcing capacity change with reserve (expensive) before a resize (cheap). Also, skipping PerformPuts if there is zero deferred variables. this was resizing the buffer before EndStep.