SONAR-5626: Refactor and test task/thread management. Analyze report