Fixed missing includes in low-level IO functions. Changed implementation of condition variables to use kernel event objects, in order to preserve compatibility with NT 5.1.
Change prefix to "thread_" and add functions for thread creation and condition variables.