ensure semaphores release