Make disabling preemption prevent a CPU migration

There are cases where a thread needs to prevent itself from being migrated
to a different CPU, for example when accessing curr_cpu. This could be done
by disabling interrupts, but just disabling preemption provides a less
heavy-handed alternative. There is also thread_wire(), but that has to take
the thread lock which makes it even less ideal than disabling interrupts
(plus, it will go away once thread affinity is implemented).

Signed-off-by: Alex Smith <alex@alex-smith.me.uk>
Disable interrupts before getting current CPU cache

Previous could have been interrupted between getting the CPU cache and
disabling interrupts, and migrated to a different CPU resulting in the
wrong CPU cache being used.

Signed-off-by: Alex Smith <alex@alex-smith.me.uk>
Switch some uses of thread_wire() to preempt_disable()

Signed-off-by: Alex Smith <alex@alex-smith.me.uk>