Avoid integer overflow in hp2ps (#9145)

This is slightly hackish, but hp2ps is already convoluted enough
that I don't feel bad about it.