Make TaskTest.nmap6 test robust with CyclicBarrier

See comments in code for details.