Add option for vertical scrolling support in Android App.

A potential customer (currently a free user) contacted us asking
that MuPDF be extended to support vertical scrolling rather than
horizontal scrolling. He supplied a partially working patch.

We reviewed his patch, and found the bit he'd missed, which he added
and it now works for his purposes. We also spotted some places
where his patch is incorrect in general though (and will go wrong
for cases where PDF files have varying page sizes).

This is a commit of a correct version. ReaderView gains a
HORIZONTAL_SCROLLING boolean that is set to true currently to
maintain the normal behaviour. Change it to false and we will
scroll vertically instead.

Possibly we could add a button to allow this to be a runtime option,
but that's a future enhancement.
Update test-device to check images piecemeal.

Rather than decoding entire image only to give up after we find the
very first pixel is color, add code so that the test-device can
treat the image as a stream. This means that (for most image types
at least) we can bale out without decoding everything.

This reduces the runtime of 3001Pages.pdf from 14 minutes to 18 seconds.
Bug 695440: fix buffer underflows in load-jpeg.c

With this change, all 32-bit values read from untrusted data through
read_value are compared unmodified in order to prevent unintended
integer overflows during the comparison.
Revert part of commit 5509a4ef7520bf0b5280ce7d6af8eb15b1b8b0f1

Even though the encryption key length isn't supposed to be taken from
the encryption dictionary's /Length for crypt version 4, other readers
such as Adobe's still use that value if a crypt filter's /Length is
missing.

See https://code.google.com/p/sumatrapdf/issues/detail?id=2710 for a
document where this makes a difference (or simply remove /Length from
the crypt filter in any document encrypted with crypt version 4 and an
AESV2 crypt filter).