refs #9084 fixing build

and probably reverting Coverity warning bout the resource leak. But in fact tread sheduler is deleted by thread pool.
Merge branch 'bugfix/9048_smallWinBugs' into develop