kernel/swap: Move arch_cohere_stacks() back under the lock
kernel/swap: Move arch_cohere_stacks() back under the lock

Commit 6b84ab383050 ("kernel/sched: Adjust locking in z_swap()") moved
the call to arch_cohere_stacks() out of the scheduler lock while doing
some reorgnizing.  On further reflection, this is incorrect.  When
done outside the lock, the two arch_cohere_stacks() calls will race
against each other.

Signed-off-by: Andy Ross <c70f9a6bf6ee0cd69c8af4ce5e6b131945769315@intel.com>

Vudentz/zephyr,finikorg/zephyr,finikorg/zephyr,finikorg/zephyr,galak/zephyr,galak/zephyr,Vudentz/zephyr,nashif/zephyr,zephyrproject-rtos/zephyr,galak/zephyr,finikorg/zephyr,Vudentz/zephyr,galak/zephyr,zephyrproject-rtos/zephyr,Vudentz/zephyr,zephyrproject-rtos/zephyr,nashif/zephyr,nashif/zephyr,zephyrproject-rtos/zephyr,nashif/zephyr,zephyrproject-rtos/zephyr,Vudentz/zephyr,nashif/zephyr,galak/zephyr,Vudentz/zephyr,finikorg/zephyr