lib: cmsis_rtos_v2: kernel: Fix a coverity issue
lib: cmsis_rtos_v2: kernel: Fix a coverity issue

Fixes an issue corresponding to CID: 190641

Fixes #12292.

Signed-off-by: Rajavardhan Gundi <b08addc5b57f0413e0a4ff6bc495295037640485@intel.com>

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