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