Merge context switch pend changes from TNKernel-PIC32