Fixed thread.c

- new setting the STATUS_LOCAL_MEMORY flag
- not trying to set the tcb->local_mem field anymore