Fix collation of UTF-8 strings

There were a few problems here after commit
12b7cc0dddec9203878a3f91ef4e11768c01b857:

1) The API ucnv_toUnicode expects the target and source pointer
   limits to be 1 past the last valid byte;

2) In compareUnicode we were overriding the original string lengths,
   which would make the call to compareUnicodeSlow on failure get
   wrong string lengths;

3) size_t is an unsigned type, so the error checking was not working
   because a size_t value is always >= 0

Change-Id: Ia427e730d558edc6de523ba72717f49fe153b50e
Reviewed-on: http://review.couchbase.org/29987
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>