use pthread_equal function instead of comparison
work in progress: screen_api_test

get rid of api_test and have screen_api_test write all of
its test results to a file. require modified ccan/tap module
fix linking of shared tap object & api_test.h bug

i think that tap.so has to come before libccan.a so that tap
symbols resolve from tap.so and not libccan.a

in api_test.h we were closing the tap output file in the child
but still using tap diag function calls. somehow this messes up the
child such that none of the data written to the pipe makes it through
to the parent.
add valgrind version of screen_api_test

also take screen_api_test out of the "tests" target.

also checkout "cantora" branch of ccan.
cleanup some dead code
add helgrind targets to make file
print received bytes when on_r_interaction test fails
build tap.so to be thread safe
err_exit writes to stdout+stderr. err_warn writes to stderr
improve plugin initialization state guard

the variable guards against invocations of api callbacks
before the plugins have been initialized. valgrind didnt like
that it was not being locked in the same way in all the places
it is used.
add a lock to g_on_r_interaction to make helgrind happy

its probably not actually needed
api test is helgrind clean

had to increase the time before the child process 'types' exit
into the test shell because helgrind is so slow and we were
exiting before all the tests could finish
setup to toysh for use in screen_api_test

id rather use this instead of sh/bash because i feel its bad form
to have a potentially buggy test program entering shell commands
into the actual system.
restore optional redirection of curses screen in ncurses_test.h

panel_stack_test needs this.
add target to check that all tests are memcheck clean
added drd tool valgrind targets
added sgcheck targets
sgcheck suppression

i think sgcheck is just confused because of my 'array of arrays' access
pattern of the token arrays.
fix typo in ncurses_test.h
comment out sgcheck stuff

im having a hard time understanding the errors it reports (and
differentiating between real problems and false positives). plus
its crashing when i run it with screen_api_test.