configure: Intelligently detect what flags/libs get us working pthread, and define HAVE_PTHREAD_CANCEL if pthread_cancel is available
If pthread_cancel is missing (Bionic/Android), emulate it using pthread_kill and pthread_exit
If pthread_cancel is missing/emulated, set asynchronous thread cancel type on stage, watchdog, watchpool, and longpoll threads since the emulation cannot support deferred cancellation
Check for ?e##toh macros independently from hto?e##
gnulib: stdint: Add support for Android.

* lib/stdint.in.h: When included from Bionic <sys/types.h>, just
include the system's <stdint.h>.
Reported by Simon Josefsson <simon@josefsson.org>.

Conflicts:
	ChangeLog
gnulib: stdint: Improve support for Android.

* lib/stdint.in.h: Test __ANDROID__, not __BIONIC__.
Reported by Simon Josefsson <simon@josefsson.org>.

Conflicts:
	ChangeLog
gnulib: stdint: fix build with Android's Bionic fox x86

* lib/stdint.in.h: fix check to test if included-fixed/sys/types.h
was already included as _SSIZE_T_DEFINED_ might also be defined
in include/machine/_types.h, which is included by stdio.h

Signed-off-by: Eric Blake <eblake@redhat.com>

Conflicts:
	ChangeLog
Merge branch 'android' into bfgminer

Conflicts:
	Makefile.am
	configure.ac