CCBC-284: compute item size correctly during set

If minSize and maxSize are set to the same value
cbc-pillowfight can sometimes crash since it may try to read
out of memory bounds from the allocated data buffer.

Avoid that crash by correcting item size to be within maxSize
Change-Id: Ica6d598f66eb3e4b696cef9ac384fa5d9362a5ed
Reviewed-on: http://review.couchbase.org/29724
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>