Properly terminate web workers

Now that `Chrome 34.0.1847.131 m` is out and fixes [361782](https://code.google.com/p/chromium/issues/detail?id=361792), we can put back the code removed in #1604 and properly terminate the worker.