LPS-45883 Restore original thread value local after test execution

cc/ @cgoncas