Use buffer of len 0 for jsoncollate encode and decode

If len == cap, jsoncollate encode and decode will be
noop.

Change-Id: I1295364da1b8fb8112a5288e1c4cf5d0dfceb947
Reviewed-on: http://review.couchbase.org/43276
Reviewed-by: Deepkaran Salooja <deepkaran.couchbase@gmail.com>
Reviewed-by: Sarath Lakshman <sarath@couchbase.com>
Tested-by: Sarath Lakshman <sarath@couchbase.com>