Changed a couple of variable names... OSX code is still broken.
Changed the thread result error from int to hex to match up with the header file.
Fixed thread result on both the start and the stop this time,
I think this should take care of the thread safety issues on OS X.