bpo-41818: Close file descriptors in test_openpty (#GH-24119)

When stdin is a TTY, the test added in commit c13d89955d9a2942c6355d6839d7096323244136
is expected to fail. However, when it failed, it did not close
its file descriptors. This is flagged by the refleak tests (but
only when stdin is a TTY, which doesn't seem to be the case on CI).

1 file changed