CBQE-0 :: fix clean up when we failover master node

Change-Id: I251f4c8fa24db056d46f70f53985d18e5104ed18
Reviewed-on: http://review.couchbase.org/40144
Reviewed-by: Thuan Nguyen <soccon@gmail.com>
Reviewed-by: Parag Agarwal <agarwal.parag@gmail.com>
Tested-by: Parag Agarwal <agarwal.parag@gmail.com>