CBQE-984: fix wait_till_compaction_end function

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