gh-159739: Release tuple items if resizing fails (GH-159754)

Release the references still held by the original tuple when
reallocation fails.

Backport to 3.15 and 3.14.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2 files changed