Apply the GRAYSCALE_1BPP optimization when `needsDecode` is set.

The scanned, black-and-white document at
https://bugzilla.mozilla.org/show_bug.cgi?id=835380 doesn't benefit from
the critical GRAYSCALE_1BPP optimization because the optimization is
skipped if `needsDecode` is set.

This change addresses that, and reduces both rendering time and memory
usage for that document by almost 10x.
Merge pull request #5204 from nnethercote/needsDecode

Apply the GRAYSCALE_1BPP optimization when `needsDecode` is set.