Revise encoding finalization so that it does a more complete job of restoring
the pre-initialized state.  This makes finalization errors more repeatable
and cross-platform.
Rework the *FinalizeThread*() routines so that the quick exit preference
is respected without need to run afoul of encoding finalizations.
tests pass now.  All changes are fully internal.
[af08e89777] Rework finalization to stop encoding-24.2 segfault.