port thread pool patch to PSI 4.0b4, and use it to fix 'hanging' tests

@wpoely86: Please review, I want this in EasyBuild v1.8.2 which I hope to release **today**.