fix: lock the translator list when adding the local exception translator (#6208)

* Initial commit for fixing a data race in the local exception translator

* only run the translator race test on free-threaded builds

* fix: guard translator locking on older free-threaded Python

---------

Co-authored-by: Ralf W. Grosse-Kunstleve <rgrossekunst@nvidia.com>
5 files changed