Remove compile warning

variable ‘written’ set but not used [-Wunused-but-set-variable]

Change-Id: I3916131e4fad6a7a96c9e46579056e2352496e79
Reviewed-on: http://review.couchbase.org/42825
Reviewed-by: Dave Rigby <daver@couchbase.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>