MB-7656 Deal with btrees having no reducers in a safer way

If the view has no reducers, then don't malloc memory blocks of
0 bytes - this is undefined behaviour. The man page for malloc
(and calloc) mentions this:

"If size is 0, then malloc() returns either NULL,
 or a unique pointer value that can later be successfully
 passed to free()."

So just set the reduce value buffers to NULL and avoid any allocations
which are not necessary.

Also added a test for the scenario where a reduce context is created
and there are no reduce functions (neither JavaScript nor builtin).

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