Add assertions on tracemalloc_reentrant_key

Issue #26588.
1 file changed