Fix for deadlock on win32
Merge pull request #24 from ahungry/master

Fix for deadlock on win32