PSOutputDev: Fix wrong text generation

This patch moves the code to update the max valid glyph hash into its
own function and updates the max valid glyph only if the new value is
higher than the previous value.
This fixes a problem with pages that have multiple copies of the same
font with different glyph counts. If poppler processed the font with the
smaller count last, and then the PDF wrote text in the font with the
larger count, pdftops would not show the glyphs above the maximum of the
smaller font.

Bug #102760
2 files changed