Fix race condition in test_rm.