tsan: add SetEnv() function that can be used in frontends