Fix this test to work properly with -threaded