tests: Fix tests that were defect

Was part of #1556. @Kijewski asked me IRL to split it

* 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