close security hole opening semaphore file in /tmp