Changed condition variables to WaitForSingleObject

For XP support
Removed unused variable and cleaned up var names
Merge pull request #740 from bkase/condition-variable-gone

Changed condition variable API so that XP would work r=@ochameau