CBD-51: Use constants instead of magic numbers

Change-Id: I7ceae86b1d3c2ae795bb6da08a08760d90fab8f7
Reviewed-on: http://review.couchbase.org/27567
Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
Tested-by: buildbot <build@couchbase.com>