Lps 47797 Add unit test for threadlocal leaking fix