Test Fixes - Restore original thread value local after test execution

First PR after splitting yesterday's pull, cc/ @cgoncas