fixed another minor bug in semaphore.py