MB-7656 Don't segfault on empty reductions and buffers

If the reduction was 0, this was segfaulting. If the input buffer
was 0 too, which it segfaulted too.

Both cases are valid for views, and therefore it shouldn't segfault.

Change-Id: I5b5ac1466135fa0cd50641afa0744113b9bfd248
Reviewed-on: http://review.couchbase.org/28844
Reviewed-by: Aaron Miller <apage43@ninjawhale.com>
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Tested-by: Aaron Miller <apage43@ninjawhale.com>