threads: one_time_init, thread_cancel.

Solution to Exercises 31-1 and Listing 32-1.
threads: thread_cleanup.

Listing 32-2.
Merge branch 'master' of https://github.com/litianqi/tlpi