Remove boilerplate wait from operations

Refactor most of this stuff into the common_vars system

Change-Id: Id76a0716eb414aa13f4c4c0f6cdae12bac21ae1d
Reviewed-on: http://review.couchbase.org/26809
Reviewed-by: Pavel Paulau <pavel.paulau@gmail.com>
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Tested-by: Mordechai Nunberg <mnunberg@haskalah.org>