count is not working when raise_error is False

Should pass count param to `wait` function when `raise_error` is False.

I have spent several days to debug a wired behavior of my program caused by this bug. Hope this could save other people some time in similar situation.