unit-tests: Add a semaphore wait cancel test