Bug 1016412 - Fix intermittent error in async_semaphore_test.js

And also make them pass jshint

https://bugzilla.mozilla.org/show_bug.cgi?id=1016412