tsan: add a useful debug check