Remove the test that introduces state leaks.

Similar behavior is tested in the next test case
`test_thread_variable_in_enumerator`.

Follow up on #15770.

cc @senny, @rafaelfranca