tsan: fix a bug