Terminate web worker on close