Move thread state definitions from mt.c to mt.h