[Python-checkins] gh-127614: Correctly check for ttyname_r() in configure (#128503)