Added in support for pthread_detach

Hello,

I added in support for pthread_detach. I wasn't sure about the style guidelines so I tried to match what I found the best I could. I have also included a test. 


Please ignore the other pull request, because I screwed it up.

Best Regards,
Will