Dining philosophers implementation in python using semaphores and locks