MB-12251: Throw dimensionality error early

Throw the error when the query dimensionality doesn't match the index
dimensionality as early as possible. This way you get a proper HTTP
response back from a single node. Else it would first send the 200 OK
header, and then also the 500 headers which isn't valid HTTP..

Change-Id: I051361ed6b63e5d11bd0e43ff235564722faf1aa
Reviewed-on: http://review.couchbase.org/42757
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Sarath Lakshman <sarath@couchbase.com>