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 __alloc_size__ availability detection (Clang)

Since __clang_major__/__clang_minor__ etc. are vendor dependent values,
we cannot implement the feature detection based on it.
For example, Apple clang versioning is different from the FreeBSD clang.
(At this time, Apple clang version is "6.0 (clang-600.0.51)" and
__clang_major__ is 6.)
Instead of this, we can use the clang feature detection macro,
__has_attribute.

* include/gc_config_macros.h (GC_ATTR_ALLOC_SIZE): Replace predefined
__clang_major/minor__ testing with __has_attribute() one (in case of
clang).
Fix missing error handling of pthread_attr_init/getstacksize

* misc.c (GC_init): Explicitly ignore returned value of
pthread_mutexattr_destroy.
* os_dep.c (GC_get_main_stack_base, GC_get_stack_base, GC_dirty_init):
Likewise.
* pthread_support.c (start_mark_threads, pthread_create): Likewise.
* tests/test.c (main): Likewise.
* win32_threads.c (start_mark_threads): Likewise.
* pthread_support.c (pthread_create): ABORT (with the appropriate
message) in case of pthread_attr_getstacksize or pthread_attr_init
failure.
* tests/test.c (main): Print error code and FAIL if pthread_attr_init
or pthread_attr_setstacksize failed (only if GC_PTHREADS).
Fix missing msvc_dbg.h in dist_noinst_HEADERS (Automake)

* include/include.am (dist_noinst_HEADERS): Add msvc_dbg.h entry.
Fix missing cord_pos.h, ec.h among installed headers (Automake)

* cord/cord.am (pkginclude_HEADERS): Add cord_pos.h, ec.h entries.
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).
GC_stack_range_for iOS 32/64-bit code refactoring (Darwin/arm)

* darwin_stop_world.c (kCFCoreFoundationVersionNumber_iOS_8_0): Move
definition out of GC_stack_range_for.
* darwin_stop_world.c (GC_stack_range_for): Refine comment and abort
message; eliminate code duplication regarding thread_get_state call.