MB-8286 Explicit error message if user reduction is too large

If the reduction produced by a JavaScript reduce function is too
large (i.e. larger than 64Kb), raise an explicit error with
a much more friendly error message. Before this change, we would
encode the reduction's size as a 16 bits integer which didn't
match the binary size when the later was larger than 64Kb, and
later cause a badmatch error.

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