tsan: fix clang warning:
comparison of unsigned expression >= 0 is always true
tsan: flush metamap per-thread cache when thread finishes