CBQE-2450: n1ql:fix slicing

Change-Id: I16a13771927de5183ad725c82b76ee13d47cbc02
Reviewed-on: http://review.couchbase.org/42618
Reviewed-by: Iryna Mironava <irynamironava@yandex.ru>
Tested-by: buildbot <build@couchbase.com>