MB-8286: Refactor into utils module

Refactor the actual key and value size checks out into
couch_set_view_util so that they can be re-used by the
spatial index.

Change-Id: I9f5ca454ef80fa6a0601a5b557be8b878713600e
Reviewed-on: http://review.couchbase.org/27277
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>