[dynamicIO] use new heuristic to track whether server render is dynamic (#73751)
Instead of relying on onError just use the timing of the prerender
resolution to determine whether the server render completed before
aborting.
React is going to remove onError and onPostpone calls from `prerender`
in flight [31715](https://github.com/facebook/react/pull/31715). This is
because semantically the error is going to be hidden from the prerender
and on resume it might not error. So rather than relying on whether the
error callback is called we simply infer whether we are done by checking
if the `prerender` resolved prior to our abort deadline. In our case it
is possible we also aborted earlier than the deadline because you can
call something like `Math.random()` which requires the `prerender` to
halt synchronously so we also check the signal status in our deadline
task.
We don't expect this to change any semantics so there are no altered
tests.
This is only currently implemented in the dynamicIO + PPR case because
that is the only case using experimental React with `prerender`. When
dynamicIO is on by itself we still use `renderToReadableStream` which
does not have halt semantics. We will switch to `prerender` when it is
available in React's stable channel