thread: Introduce thread_new and thread_free to cover handle leaks on WIN32
7 files changed