bpindex; fix several race conditions in test case