Use __thread for TLS on OSX
Make proctree traverse not find false parents

The expression to grep for the parent PID in the python process helper
accidentally matched the suffix of unrelated process parents due to not
anchoring the PPID against the preceeding space.
Merge pull request #1049 from zao/osx-build-test-fix

Fixes for TLS on OSX and more reliable test running
Replaced some uses of wait() by wait_all()
Added tuple support to unwrapped. Added overload unwrapping without a callable, replaced uses of wait() by unwrapped()
Split when/wait into its own headers