thread.asm: Implement exit