Some cleanup in the semaphore tests