What are the differences between a semaphore and a mutex, and when would you use a binary semaphore instead of a mutex?