Fix potential infinite loop in jpeg error handling code.

Turns out that jpeg_finish_decompress can throw errors, hence
can cause an infinite loop. This is fixed here by changing the
jpeg error code to be fz_throw based.

Thanks to zeniko for this patch.

This highlights something that I hadn't fully appreciated before;
anything that throws in a fz_always region will reenter that region.
I think I have a way to fix this so that any throws in the
fz_always region go immediately to the fz_catch.
Tweak fz_try/fz_always/fz_catch to handle throws from within always.

Throwing from within the always block is bad practice, but attempt
to cope with it gracefully.
Android: allow app to be moved to sd card
Android: rework link handling

Remove unnecessary hitPageLink method from MuPDFCore and extend the
handling of external links to the java classes
Android: fix opening the wrong document from the file picker

Sort the file list rather than the list adapter, so that
the onclick position can validly be used to index the file list
ios: Use setRootViewController instead of addSubview.

Fixes warning at launch and autorotation not working on iOS 6.
ios: Use fz_document interface directly.
ios: Add button to highlight links.
Optimise sharp scan conversion as we did with aa scan conversion.

In doing this work, it strikes me that there is an unoptimised case
left in the aa scan conversion; when we are plotting whole scanlines
with gel->alen = 0, we can skip the entire blit. This happens
relatively rarely so the extra cost of the test may be more than
is worthwhile.
Bug 693290: Missed line from earlier patch causing SEGV.

A NULL pointer dereference could be caused in error cases due
to me failing to apply zenikos patch correctly.
Fix blend.ai.pdf - Missing "exclusion" text

When creating a group around text, the text bbox was being used as the
group bbox without transforming it. This results in missing text in
blends.

Various text sections are now appearing in some test files too.
Rejig color conversion.

Add a mechanism for getting a color converter function. Implement
the 'convert a single color' call in terms of that. 'Bulk' users
can then repeatedly call the single function.
Fix whitespace.

Thanks to zeniko for the heads up.
Fix fz_try/fz_catch in overflow case.

Thanks to zeniko for pointing out that the recent changes to
the fz_try/fz_catch macros to allow for throws in the fz_always
block had broken the exception stack overflow case.

Thanks also for the example file (nesting stack overflow.pdf),
which has now been added to the regression suite.
Fix use of text_bbox with pattern filled text.

Following on from the blend.ai.pdf disapparing text fix that went in
the other day, zeniko has pointed out that we should be using the
device space on entry to pdf_show_pattern too. Fixed here.

Many thanks.
Forms: refactor form reset

The way the forms to be reset is specified is used also in form
submission. This commit pulls out that selection method as a
separate function that returns the set of affected forms as a
pdf array object.
Android: add hooks to the app to handle GoToR links
Bug 693290: PDF cmap range warnings

Thanks to zeniko for these.
Bug 693290: Fix use after free in obj stream handling.

Thanks to zeniko for pointing this out. If we encounter a new definition
for a given object (presumably due to a repair operation), we used to
throw the old one away, and keep the new one. This could cause any
current holders of the object to be left with a stale pointer.

Now we throw the new one away and keep the old one - with a warning
if they are different.
Bug 693290: PNG image fuzzing issues.

The issues fixed here were found by zeniko - many thanks.
The patch here is our own work - larger change, avoiding casts
for a (hopefully) neater result.