Cleans up after a thread that has finished. Wait for it first with thread_is_done(*thread, -1); after this the Thread can be reused or dropped.
thread_is_done(*thread, -1)
Thread
thread_deinit :: (thread: *Thread)