Avoid failing sometimes in the test_parallel_wait

Control flow by thread queue instead of sleep
Merge pull request #47 from jca02266/fix-test

Avoid failing sometimes in the test_parallel_wait