Threading issue with MacOSX 10.8

Hi
This should solve #298 on MacOSX 10.8. I didn't tested 10.7/6 or iOS.
Merge pull request #300 from remoe/patch-2

Threading issue with MacOSX 10.8. Should solve #298