Fix race condition in Raft unit test.