Fix thread cleanup after main exits.
Fixes a use-after-free in the main thread cleanup code, which caused contain_test
to trigger kstop by killing an undefined PID (which in this case became 1, i.e. kmain).
Fixes a use-after-free in the main thread cleanup code, which caused contain_test
to trigger kstop by killing an undefined PID (which in this case became 1, i.e. kmain).