bpo-36436: Fix _testcapi.pymem_buffer_overflow() (GH-12560)

Handle memory allocation failure.
2 files changed