PR tidy based on feedback

* Updated `thread_create` so that it has 3 parameters, and removed
  `thread_create3`.
* Updated all calls to `thread_create` and added the extra parameter of
  `NULL`.
* Fixed comment typo.
* Removed assignment where value is not used.
* Checked for `NULL` prior to setting the result.
* Undefined `DEBUGTRACE`.