Fix exceptions when running mocha in Web Workers.
Merge pull request #867 from pwnall/web-workers-3

Fix exceptions when running mocha in Web Workers.