MB-32589: AddStatsStream: Correctly account allocated mem to NonBucket
MB-32589: AddStatsStream: Correctly account allocated mem to NonBucket

AddStatsStream simplifies the calling of the ADD_STAT call when
building a stream of output. However the underlying ADD_STAT callback
can allocate memory which is *not* freed in the ep-engine context -
it's freed by Connection::releaseTempAlloc() inside the daemon.

Therefore it is incorrect to account any memory allocated via ADD_STAT
to the current ep-engine instance - which is what currently happens
when using AddStatsStream. The effect of this is that the mem_used of
a bucket will incorrectly grow everytime AddStatsStream is used. As a
consequence the mis-accounted memory is essentally stolen from the
bucket quota - that amount of memory is no longer available to the
bucket.

There are currently two uses of AddStatsStream - the undocumented stat
groups '_checkpoint-dump' and '_hash-dump' - both of which require
Privilege::Stats (and not just Privilege::SimpleStats). The lowest
Security Role which grants this privilege is `Read-Only Admin`. As
such while the severity of this is high, the liklihood of users
encountering this is expected to be low.

Fix the issue by using a NonBucketAllocationGuard to not include any
memory allocated via ADD_STAT in ~AddStatsStream.

Change-Id: Iea7c2a16e7b6e0754a3588f7e017b162e62a8bf2
Reviewed-on: http://review.couchbase.org/103545
Reviewed-by: Paolo Cocchi <9dd88c9f3e5cbab6e19a6c020f107e0c648ac956@couchbase.com>
Tested-by: Build Bot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>

daverigby/kv_engine,daverigby/kv_engine,daverigby/kv_engine,daverigby/kv_engine