[Python-checkins] cpython (3.4): fix use after free (closes #24552)