Not sure if this will work with web worker. Do you create the object on window? If so you can try this:
delete window.worker
Maybe call terminate and then delete it?
window.worker.terminate();
delete window.worker;
The documentation states that it'll stop everything but doesn't clean up when terminate() is called.