2 new thread functions

I added two new thread functions because there wasn't a proper way to wait a thread to finish. 

wait(): wait until thread has finished
release(): release all allocated resources etc.

I have no idea if the pthread version is going to work because I'm unable to test that

There's also a new struct called ThreadHandleData, which can be used to store platform specific thread handles etc.
ThreadHandle is just a typedeffed ThreadHandleData pointer. createThread should return a new ThreadHandle, which can be later used to identify the thread.