CBQE-0: fix index waiting function

Change-Id: I995a6173a7fc4d1c0b980ada00ef71a511086679
Reviewed-on: http://review.couchbase.org/30759
Reviewed-by: Andrei Baranouski <andrei.baranouski@gmail.com>
Tested-by: Iryna Mironava <irynamironava@yandex.ru>