SERVER-8677 Remove race condition in test