Make Process.WaitForExitAsync wait for redirected output reads (#42585)
* Make Process.WaitForExitAsync wait for output reads
Addresses an issue where Process.WaitForExitAsync
doesn't wait for background redirected output reads,
a behaviour which diverges from the sync method
equivalent. Fixes #42556.
* address feedback
* pass cancellation token to AsyncStreamReader waiter
* address feedback
* use tcs.TrySetResult
* Update src/libraries/Common/src/System/Threading/Tasks/TaskTimeoutExtensions.cs
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>