This is an improvement to #49921 which reaps threads after the timeout expires instead of letting them continue to take up resources.