Implemented workaround for Windows not having threadWaitRead and threadWaitWrite.