ISPN-3245 ReplSyncDistributedExecutorTest.testTaskCancellation fails intermittently

Replace the counter with a CyclicBarrier.
The same for DistributedExecutorTest.