improved signal handling

previously we were using mutexes within signal handlers
which is a practice which seems to be somewhat unstable.
these changes simply switch to a multithreaded model where
we have a thread devoted to handling SIGWINCH and SIGCHLD
which poll for signals using the sigtimedwait function.

happily this fixes some of the strange signal behaviour i was
seeing when running screen_api_test under valgrind.
Merge branch 'use_sigwait' into port_osx

Conflicts:
	src/aug.c
use sigwait instead of sigtimedwait

OSX (and openbsd?) dont have sigtimedwait :(