Cherry-pick an extra upstream patch to fix a regression in 2.13.1-4.
Closes: #959800. Thanks, Jonathan Kew!