Always rebuild static libraries in unix, instead of updating them

The u modifier to to the ar replace command tells ar to only
insert those object files into a static library that are newer
than those already in the library (both having the same name).
Moreover ar only stores timestamps down to second accuracy.

This may cause situations where the object file already inside
the library is considered equal to a newly built object file
(which might include a new function) because their timestamps
differ only in the sub-second part. One of the apps might have an
object file that references this new function. Since the static
library retains the old object file there will be a linking error
when linking the app. Even re-running make will not fix the issue
since the static library will have its modification time updated
to a timestamp later than the newly built object file, which
means that ar will not be run again. The only option is to make
nuke and rebuild from scratch.

From now on, the u modifier to the ar replace command is removed.
This means that ar will rebuild static libraries without taking
timestamps of object files into account, to make sure that the
build never ends up in the situation described above.
Fix typo in PDF function code

This is just a lexical change, no semantic change as
the MAXN and MAXM constants are equal.
Handle invalid obj/gen numbers when repairing pdfs

Out of range object numbers cause the repaired object to be
ignored. Out of range generation numbers are clamped to the
permitted range.
Only warn once about ignoring rendering errors
Fix bug where too many content stream operands cause eternal loop

Once enough operands were push on top of the operand stack an
exception would be thrown. The exception handling ignored the
exception, printed a warning and continued processing the content
stream. Unfortunately the token was never consumed, so once the
interpreter retried parsing the stream it encountered the same token
again, causing the loop and thus a stack overflow. Now, make sure each
token is consumed before throwing a new exception thereby breaking the
eternal loop and letting pdfs with excessive operands be rendered,
albeit with both errors and a warning.
Handle exceptions better in mupdfclean

pdf_write_document() may throw an exception and this was uncaught up
until now.
No need to check for NULL before dropping objects
Set refs to NULL in pdf repair so object are not freed
Make use of fz_always instead of repeating code for error and normal path
No need to drop object for which no reference has been kept
Free decoded jpx image upon error

Thanks to Zeniko for pointing out this fix.
Add a make target for measuring code coverage
Make sure images are freed upon loading error

There was a call to fz_drop_image() in the error handling code,
however the fz_storable freeing function was not yet set which
meant that the image was not freed. Instead call pdf_free_image()
to free the image.
Upon parse error when repairing, make sure object stream is freed

Previously, during repair of a pdf, an object stream was loaded and an
attempt was made at repairing the objects stored inside the object
stream. Failure to repair the stream caused an exception which was not
handled by the code loading the object stream, it was just passed on.
This meant that the loaded object stream caused a memory leak. Now we
catch that exception, free the object stream and rethrow the exception.
Fix comparison of cmap table length against maximum value

The cmap table length counts how many entries there are currently in
the table. The table length was previously tested against USHRT_MAX
which is 65535. However, the desired value to compare with was 65536
which would be the maximum number of entries allowed in a cmap table.
All comparisons of the cmap table length are now using USHRT_MAX + 1.
Only warn on stitching function's sub function with wrong arity

Sub functions that make up a stitching function can be evaluated with
the wrong number of inputs/outputs, so it is not necessary to throw an
exception if the number of inputs/outputs do not match when loading
sub functions.
Throw exception on too deeply nested arrays/dicts

Previously we would run out of error stacks in the context and fail abruptly.
Now, throw an exception and hope for the best. At least this plugs any memory
leaks.
Free inline image dictionary upon error parsing image
Free old stroke state when initing graphics state from another state

Thanks to Zeniko for pointing out this fix.
Expose both PDF encryption version and revision

Thanks to Zeniko for pointing out that version as missing.