chore: cherry-pick 72ee7c437c88 from chromium #25243
[Merge to M84] Worker: Fix a race condition on task runner handling
WebSharedWorkerImpl accesses WorkerScheduler from the main thread to
This causes a race condition if close() is called on the global scope
To fix this, this CL makes WebSharedWorkerImpl capture the task runner
(cherry picked from commit c7bbec3e595c4359e36e5472b7265c4b6d047f2c)
Notes: Security: backported fix for 1104046.