virtual_free_teb called on thread exit can save memory. pthread_create run start_thread_wrapper on a small size stack, start_thread_wrapper calls start_thread and switch on a big size thread stack. when thread exit, switch stack pointer return to the small size stack and free memory of the thread.
Signed-off-by: Fan WenJie fanwj@mail.ustc.edu.cn