Fix leak in Task.WaitAny(..., int) (dotnet/coreclr#10331)
WaitAny is effectively built on top of WhenAny, creating a continuation from the supplied tasks and then blocking on that continuation. When a timeout is provided, it blocks with that timeout. But if it doesn't complete within the timeout, it ends up leaking the continuations it created into the constituent tasks. The fix is simply to force the returned continuation to complete, such that its continuation logic does all of the appropriate cleanup.
Commit migrated from https://github.com/dotnet/coreclr/commit/
d6e9a08a70dab11ddc845fb0ccf36aa436e9ebec