move MAX_CHAR_TYPE to thread.h to remove useless reference to widechar.h