[TSan] Make this test more portable