add timeout option to semaphore's acquire method to ensure parity with lock