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>
Merge remote-tracking branch 'origin/2.1.1'

* origin/2.1.1:
  MB-8286 Explicit error message if user reduction is too large

Conflicts:
	src/couch_set_view/src/couch_set_view_group.erl

Change-Id: Ieb079c96797ec027f2c7260b09529bd90de430d2