Hotfix: Wrong condition on sempahore

Fixing wrong condition on semaphore which was leading to deadlock. 
You can reproduce error by creating Semaphore(1), 3x call wait(), 1x call signal() and you will get deadlock.

For semaphore references: 
http://www.cs.jhu.edu/~yairamir/cs418/os3/sld019.htm

http://en.wikibooks.org/wiki/Operating_System_Design/Processes/Semaphores