Fixed bug with msleep

Kinda forgot that msleep will change the current process so you can't
just assign a value to a register through the context pointer. That will
assign it to some other PCB, which is bad.
Added conditional compilation flags for debug messages