- gaia_thread: simplify the lock loop
- gaia_lookup: pass proper sigval to function
- include <string.h>, for memcpy()
- depend on HAVE_PTHREAD not HAVE_PTHREAD_H - to avoid
messing with non-threaded errno.
Make sure <ctype.h> functions accept 'char' values.
On arches where plain 'char' is signed, <ctype.h> functions
need to work on negative values.
Some OSes do it already (Linux), some don't (BSD, Windows).