Issue #13019: Fix potential reference leaks in bytearray.extend().
Patch by Suman Saha.