don't perform for-effect work inside assert

Because assert can be compiled-away if NDEBUG is defined.

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