Fix TaskTest.nmap6 test

Fix #756.

Don't assume that thread scheduling is deterministic or that
Thread.sleep can be a form of synchronization.
(One could maybe also remove the Thread.sleep calls, to speed up the
test). Depending on the actual intent of the test, this might or might
not be appropriate.
Try making TaskTest more robust
Make TaskTest.nmap6 test robust with CyclicBarrier

See comments in code for details.
Merge pull request #758 from Blaisorblade/topic/testnmap

Fix TaskTest.nmap6 test