vthread: allow programs to have threads exit on halt.