Use globalThis flag instead of render side-effect for recovery test
The module-scoped `hasThrown` variable flipped during render, which is
fragile if React re-renders multiple times. Use a `globalThis` flag
toggled via a route handler so the test explicitly controls recovery.
https://github.com/vercel/next.js/pull/89685#discussion_r2854286441