Fix race condition in reset api test.