Added at_thread_exit. Added support for thread_specific_ptr cleanup on its destruction.

[SVN r86445]
sync: introduce spin_mutex

[SVN r86447]