Implement the registry benchmark using condition variables
Implement the registry benchmark using condition variables

The benchmark was previously becoming deadlocked when run under
ThreadSanitizer on the CV slaves with more than 2 threads.

The reason behind this is unknown but forcing more of the logic
to be done under mutual exclusion via use of a condition variable
instead of an atomic and a busy loop seems to resolve this.

Change-Id: Ie48cda8dab11851c23a8866dd36f99ec7f576eed
Reviewed-on: http://review.couchbase.org/79653
Tested-by: Build Bot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>
Reviewed-by: Dave Rigby <a09264da4832c7ff1d3bf1608a19f4b870f93750@couchbase.com>

Chippiewill/phosphor,Chippiewill/phosphor