[WebKit] Avoid a possible race condition when waking up loop.