Fix concurrency issues in TestReplicationPolicyWithNodeGroup