JCBC-361: Only add CAS if not null.

Change-Id: Ia86667ce291ad9c22f4a847510df4383b07fb378
Reviewed-on: http://review.couchbase.org/31710
Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>