Refactors PdfDataLister buffering.

Fixes #5400
`chunk.length` instead?
Also, what about caching `this.buffer.length` to avoid recomputing it below?