Move common ThreadPool code to shared CoreLib partition. (#22115)