116a95fc37
A Windows dup2 (UCRT before Windows 11) closes its target before duplicating, so an OSError from the divert can leave the standard descriptor closed rather than still carrying the wire. Run the same dup2(private_fd, fd) restore the exit path uses before serving in place: an idempotent no-op when fd is already on the wire, and a re-materialization from the private duplicate when the target was closed. Adds a regression variant that closes the target as UCRT does. Also scopes the real-host logging note to the default stderr handler.