Thread IDs now use a system call in Linux

- Also fixed a logic error in log.py for tests that don't belong in the dict
- Moved the thread id retrieval into the system headers
- Logging now prepends a "0x" before the hexadecimal id of the thread