[arabic] Fix fallback shaping regression

Was broken in 615d00ea252739da57edbd980ff27e573.

Fixes https://github.com/behdad/harfbuzz/pull/48

Micro-test added.
Use atexit() only if it's safe to call from shared library

Apparently they are not (advertised as?) safe on BSD systems.
We ignore the case of static libraries.

Whitelisted on glibc, Android, and MSVC / mingw.

https://bugs.freedesktop.org/show_bug.cgi?id=82246
[arabic] Bug 82306 - Mandaic had errors in its Unicode Joining_Type

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=82306
[coretext] Use CGFont as face_data
[coretext] Fix assert on Yosemite

Apparently those functions documented as sometimes returning NULL
actually exercise that right in OS X 10.10 Yosemite.  The scratch
was too small for that.  I *think* I fixed it, but haven't tested
as I don't have Yosemite.
Minor
[wince] Try to fix some stuff on Windows CE

Based on errors seen here:
http://testresults.qt-project.org/ci/QtBase_dev_Integration/build_03837/wince70embedded-armv4i-msvc2008_Windows_7/log.txt.gz

Fully untested.
Fix hb_in_range() for types smaller than int

As exercised by hb-coretext .notdef code.
[coretext] Fix last range

Test with:

hb-view /Library/Fonts/Zapfino.ttf ZapfinoZapfino --features=-dlig[7:] --shaper=coretext
[coretext] Fix fallback detection

Fixes http://github.com/behdad/harfbuzz/pull/36
[coretext] Minor
[coretext] Simplify cluster mapping
Minor
[coretext] Always compute log_clusters

To be used soon.
[coretext] Fix buffer resize handling

We can't really resize buffer and continue in this shaper as we are
using the scratch buffer for string_ref and log_cluster.  Restructure
shaper to retry from (almost) scratch.
[coretext] Use input clusters

Before, this shaper was returning UTF-16 cluster indices instead of
returning whatever cluster values the user had had set up in the buffer.
Ouch!
[coretext] Attach marks to base clusters

Fixes https://githu.com/behdad/harfbuzz/issues/49
to the extent that it can be fixed.
[coretext] Minor

It's hard to handle all possible NULL returns from CoreText.  Add one
more...
[coretext] Pass buffer direction to CoreText

Have to use a CTTypesetter for this.
Minor