InputBuffer and Win32 Thread fixes

- Added InputBuffer to read common datatypes from a byte array in both little
  and big endian formats
- Fixed issue thread handle lookup issue under Windows that was causing
  incorrect results when Thread::currentThread() was being called.