CBQE-2450: n1ql fix type functions

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