Simplify threadlocal test

Create separate test case for heisenbug symptom.