Stopping .NET scanner fails with "Error during SonarScanner execution: Failed to preprocess files"

The cleanup of the ws{guid} directory also happens during the Component Tests phase, i.e. Sonar starts, temp directory gets created, tests run, temp directory gets deleted, Sonar ends.
The cleanup does not happen in parallel while dotnet-sonarscanner end is executing.