Add throw option in wait(::Task) (#53685)
As we discussed with @vtjnash in PR #53341, it might be useful to
introduce the `throw` option in the `wait` function for `Task`. If
`throw=false` is specified, `wait` behaves like `_wait`; it prevents
throwing a `TaskFailedException`.