Issue #14172: Fix reference leak when marshalling a buffer-like object (other than a bytes object).