arc: fix the coverity issuse in thread.c
arc: fix the coverity issuse in thread.c

fix coverity CID: 187905

issue fixes #9765

Signed-off-by: Wayne Ren <d5c6d7c4aa45e53f819f17870783d153a32ba7d0@synopsys.com>

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