Fix copyout and copyin for non 4-bytes multiple sizes

In case where length of the data to be copied was not a multiple of 4 bytes
The copy was wrong.

If the length was 4*k+n with N < 4, then the N first bytes of the source buffer
were getting copied at the end of the destination buffer instead of the N last bytes.
Update ci_curpm upon context switch