Bug 694587: Fix pattern repeat calculation

The pattern repeat calculation should be done in pattern space, but
one of the arguments in the calculation was being taken from device
space. Fix this. Also only apply the bias in the case where the
bias would make it larger.

173 progressions.
Bug 694564: Move pdf_lookup_page_obj to be iterative

Avoid recursion to avoid stack overflows.
don't fail on invalid object streams

At https://code.google.com/p/sumatrapdf/issues/detail?id=2436 , there's
a document with an empty xref section which since recently causes a
repair to be triggered. Repairs then stop when pdf_repair_obj_stms fails
on an object which isn't even required for the document to render. Such
broken object streams should rather be ignored same as broken objects
are ignored in pdf_init_document.
tolerate inline images without EOF markers

This is required for e.g. 1980_-_compressed_inline_image.pdf and
Bug690300.pdf .
Bug 693320: Avoid unaligned accesses in SHA routines.

Avoid unnecessary copies. Minimise calls to isbigendian.