Add debug message when acquiring semaphore.