Use ARM_UNIFIED_THREAD_STATE in the call to thread_get_state() on iOS7 64-bit
and up and iOS8 32-bit and up.
Fix FirstDLOpenedLinkMap for case libgc not 1st dynamically linked (NetBSD)

Current GC_FirstDLOpenedLinkMap() for NetBSD calls dlinfo(RTLD_SELF,
RTLD_DI_LINKMAP, &lm) to find link_map. So it will find link_map of
libgc.  With guile's case, libgc is link to libguile and libguile is
linked to the guile command, so libgc is not the first one in the
link_map chain.  That is why, data section of libguile, where
scm_protects exists, is not added to GC root and GC_is_visible fails.

* dyn_load.c (GC_FirstDLOpenedLinkMap): Iterate over link_map
(provided by dlinfo(RTLD_SELF)) to return 2nd element instead of the
provided one which might not always belong to libgc (only for NETBSD
and defined RTLD_DI_LINKMAP).
Merge remote-tracking branch 'robovm/thread_get_state_stack_corruption_on_ios7_64bit_and_ios8'

Conflicts:
	darwin_stop_world.c
Fix mistyped ARM_THREAD_STATE macro (Darwin/arm)

* include/private/gc_priv.h (GC_MACH_THREAD_STATE,
GC_MACH_THREAD_STATE_COUNT): Define to ARM_THREAD_STATE[_COUNT],
respectively, instead of mistyped ARM_MACHINE_THREAD_STATE[_COUNT]
(if DARWIN and ARM32).
Avoid explicit use of machine-specific x_THREAD_STATE macros (Darwin)
(code refactoring)

* include/private/gc_priv.h (GC_MACH_THREAD_STATE,
GC_MACH_THREAD_STATE_COUNT): Remove explicit definition to
PPC_THREAD_STATE[_COUNT], ARM_THREAD_STATE[_COUNT] (as the correct
values are defined via MACHINE_THREAD_STATE[_COUNT] macro).