Making the tests more resilient to thread abort exceptions on the CI server