Fix test/wait.c.
The test would fail sometimes due access to concurrent access to variable
"counter".
Merge pull request #3 from sciascid/master

Fix test/wait.c.