tsan: fix old gcc warnings
tsan: fix windows crash (incorrect stack boundaries)