tests: Fix tests that were defect

* I used pexpect instead of when expect script was not working expect, since
  TCL confuses me
* I deleted the thread_exit test since it was completely invalid
Merge pull request #1596 from authmillenon/fix-expect

tests: Fix tests that were defect