PDF: try to handle lexing errors more like Adobe Reader (fixes issue 2231)