Use IPC Semaphores for Single-Instance Check
This replaces the lock file approach with semaphores as a more modern approach. Since we can't simply delete lock files anymore, added a helper to clear the named semaphores.
@slachnit could you have a look?