[3.13] gh-154345: Fix test_posix_pty_functions() killing the worker on Solaris (GH-154346) (GH-154356)
Pushing the "ptem" STREAMS module makes a session leader without a
controlling terminal acquire the slave as one, so closing the file
descriptors sent SIGHUP to the session and killed the regrtest worker.
Disown it after the pushes, as os.openpty() does.
(cherry picked from commit
f69f7fd526b6601a74ce0852c75466a183a86cea)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>