Handle pre-commit paralellism on first installation
When the hook is run for the first time ktlint is installed. There was a check in the script that checked whether ktlint was already downloaded. Since pre-commit is running the script multiple times in parallel, there was a race condition on the first usage of the hook. In this case some executions would try to execute ktlint although the download wasn't finished yet.
To prevent this we are now protecting the installation by a semaphore.