Don't use the destructor to free thread stacks.

If we do, kernelObjects.clear() will trash perfectly good memory on
loading a state.  I guess it also makes shutdown slower.

Fixes #4186.
Fix some warnings.
Merge pull request #4197 from unknownbrackets/savestates

Fix savestates sometimes wiping thread stacks