Patch for reproducible frame_dealloc use-after-free segfault in 3.11 and 3.12

I hope this is a good place to ask—are any core developers available to take a look at this use-after-free segfault in frame_dealloc in 3.11 and 3.12? I developed a reproducible test case, diagnosed the problem, and wrote a patch.

I’d also appreciate a look at these related cleanup PRs, but they aren’t as urgent: