MB-7629: Update _stats reduce function

Descriptions: (1) Fix some compiler warnings, (2) fix the rereduce error reporting
(doc_id should be NULL) and (3) using a temporary stats_t object in
the stack instead of heap

Change-Id: I88fe6c5153f55040e7409c7082d28a2d0c424517
Reviewed-on: http://review.couchbase.org/26971
Tested-by: Fulu Li <fulu@couchbase.com>
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>