Fix exceptions when running mocha in Web Workers.