lib: posix: Return errno code
lib: posix: Return errno code

Return EINVAL errno when argument doesn't refer to
valid semaphore.

partly fixes #9993

Signed-off-by: Punit Vara <2ba5e82aa6fb4e68460f49bedefe3af5717cea9b@intel.com>

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