Avoid divide by zero crash

Change-Id: I64dd91c534b5d85bdeabd0ed4d9c96481553422d
Reviewed-on: http://review.couchbase.org/40720
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Reviewed-by: Pavel Paulau <pavel.paulau@gmail.com>