bpo-39947: Move get_recursion_depth() to _testinternalcapi (GH-18974)

Move get_recursion_depth() function from _testcapi to
_testinternalcapi to avoid accessing PyThreadState attributes
directly in _testcapi.
4 files changed