Clear stale semaphores periodically as a safeguard.