CBQE-2325: Implement stop graceful failover logic in tests

Change-Id: Icc0ea01960cdb37b0d85263152a0edcd51e6db9d
Reviewed-on: http://review.couchbase.org/39420
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Thuan Nguyen <soccon@gmail.com>