NCBC-655: Minimize time in lock to reduce contention

Change-Id: Ibb05a7144fd570eedaedd0c4b5bd9286446c2f18
Reviewed-on: http://review.couchbase.org/42242
Reviewed-by: Simon Baslé <simon@couchbase.com>
Tested-by: Jeffry Morris <jeffrymorris@gmail.com>