core: thread: use disableIRQ/restoreIRQ

Probably a good idea. Later? ;)