tsan: fix stack traces for malloc and free