Apply patch to PdfHandler

Applies the fix released as part of the MW 1.19.11 announcement.

Will need to be added to today's release.

@macbre @moliwikia @wladekb