lib: libc: minimal: add check on returned value
lib: libc: minimal: add check on returned value

Fix #32938 [Coverity CID :219508] "Unchecked return value in
lib/libc/minimal/source/stdlib/malloc.c"

The Coverity complains about sys_mutex_lock() which returns 0 if
locked. I added also the same check on returned value for
sys_mutex_unlock() which returns 0 if unlocked.

Signed-off-by: Guðni Már Gilbert <a67b89b8b42b5e36ccc84f3061af0045ff2a5bff@gmail.com>

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