[BUGFIX] Semaphore test: release system resources