Fix build with SANITIZE_THREAD