Modified fix for compatibility with poppler 0.64

This is slightly uglier than f0697de0
but avoids duplicating strings (which is unnecessary and leaked memory).

It's also closer to what upstream intended with the changes in 0.64.

(cherry picked from commit 722e1213)
Status Job ID Name Coverage
  External
failed continuous-integration/appveyor/branch