Conditionally compile RTLD_NODELETE and RTLD_NOLOAD

These are not available on OpenBSD
Merge pull request #140 from avsm/rtld-options

Conditionally compile RTLD_NODELETE and RTLD_NOLOAD
Include `pthread.h` before using pthreads functions

Fixes build on OpenBSD
Merge pull request #141 from avsm/pthread-include-fix

Include `pthread.h` before using pthreads functions
Fix raw pointer conversions with respect to arithmetic.
Fix dependencies for 'make test'.
WIP.