cpu cortex-m3_common: cleanup thread_arch.c

cleaned up and shortened the task switching code for the Cortex-M3