fix tests that caused ThreadSanitizer issues