fix statistics ring buffer so that it no longer aborts after a SetSize operation that reduces the size. #3443.
This should fix the ring buffer problem in mentioned in #3428 also.  parent ticket #2197
===VersionHistory:Pending===
Merge branch 'V7_8-branch'