misc/wasm: add workaround for missed timeout events
misc/wasm: add workaround for missed timeout events

TryBot is sometimes running into deadlocks on js/wasm. We haven't been
able to reproduce them yet. This workaround is an experiment to resolve
these deadlocks by retrying a missed timeout event.

A timeout event is scheduled by Go to be woken by JavaScript after a
certain amount of time. The checkTimeouts function then checks which
notes to wake by comparing their deadline to nanotime. If this
check fails erroneously then the note may stay asleep forever, causing
a deadlock. This may or may not be the reason of the observed
deadlocks.

Updates #28975.

Change-Id: I46b9d4069307142914f0e7b3acd4e65578319f0b
Reviewed-on: https://go-review.googlesource.com/c/go/+/167119
Reviewed-by: Brad Fitzpatrick <ae9783c0b0efc69cd85ab025ddd17aa44cdc4aa5@golang.org>

golang/go,golang/go,golang/go,CAFxX/go,nawawi/go,golang/go,CAFxX/go,nawawi/go,CAFxX/go,nawawi/go,cloudflare/go,josharian/go,CAFxX/go,akutz/go,akutz/go,CAFxX/go,josharian/go,nawawi/go,CAFxX/go,nawawi/go,josharian/go,akutz/go,nawawi/go,CAFxX/go,josharian/go,akutz/go,CAFxX/go,cloudflare/go,cloudflare/go,josharian/go,cloudflare/go,josharian/go,akutz/go,cloudflare/go,golang/go,nawawi/go,cloudflare/go,josharian/go,cloudflare/go,josharian/go,cloudflare/go,golang/go,nawawi/go,golang/go,akutz/go,akutz/go,golang/go,akutz/go