c++: fix comparison between signed and unsigned types
c++: fix comparison between signed and unsigned types

comparing int i with size_t size generates a sign-compare warning.
This commit solves the issue by giving i the type needed.
As older c standards do not allow to declare i after stack += 4 I
inserted the variable checked_stack that gets the type we need in the
comparison.

Signed-off-by: Alexander Polleti <450c35a00eb726b3b7f49f902d29e52c3acf88ac@gmail.com>

GiulianoFranchetto/zephyr,GiulianoFranchetto/zephyr,explora26/zephyr,punitvara/zephyr,ldts/zephyr,GiulianoFranchetto/zephyr,Vudentz/zephyr,Vudentz/zephyr,explora26/zephyr,zephyrproject-rtos/zephyr,kraj/zephyr,galak/zephyr,Vudentz/zephyr,Vudentz/zephyr,nashif/zephyr,galak/zephyr,finikorg/zephyr,punitvara/zephyr,nashif/zephyr,finikorg/zephyr,zephyrproject-rtos/zephyr,punitvara/zephyr,ldts/zephyr,kraj/zephyr,galak/zephyr,punitvara/zephyr,ldts/zephyr,punitvara/zephyr,finikorg/zephyr,kraj/zephyr,zephyrproject-rtos/zephyr,Vudentz/zephyr,nashif/zephyr,ldts/zephyr,galak/zephyr,nashif/zephyr,explora26/zephyr,Vudentz/zephyr,explora26/zephyr,GiulianoFranchetto/zephyr,explora26/zephyr,zephyrproject-rtos/zephyr,nashif/zephyr,ldts/zephyr,GiulianoFranchetto/zephyr,zephyrproject-rtos/zephyr,finikorg/zephyr,galak/zephyr,finikorg/zephyr,kraj/zephyr,kraj/zephyr