Bug 694118: Fix valgrind warning caused by overflowing function

We were miscalculating the offsets into a sampled functions table,
causing us to overrun the end. Fixed here.
Bug 694127: Valgrind fix for pdf_decode_cmap

A poorly formed string can cause us to overrun the end of the buffer.
Now we check the end of the string at each stage to avoid this.
Update mupdf to use latest openjpeg pulled from ghostpdl.

The OpenJPEG in gs is v2, with various patches for fixes. These are in
the process of being passed upstream. We now automatically pull the
openjpeg tree out of GhostPDL and put it in as one particular branch
in the thirdparty/openjpeg.git repo. Change to track this in MuPDF.

This is in keeping with what we have been doing with the jbig2dec
repo for a while now.
Put thirdparty config headers in separate directories.

Only -I the config header directory if building the thirdparty library,
not if using the system library.

Fix bug 694808.
Update jbig2dec to latest version from gs.

Thanks to Shelly for pointing out that this needed to be done. This
might solve bug 694362.
Pull in the latest jbig2dec changes.

These were the last few fixes that went back from mupdf to gs.
This seems to solve bug 694362. Thanks to Shelly for this.
Bug 694362: Pull latest jbig2dec changes in.