Fix badarg exception due to concurrency issues when testing replica set recovery