tests: posix: fix semaphore.h test
tests: posix: fix semaphore.h test

Previous implementation was buggy, destroying
resources with pending thread and race conditions.

New version tests basic functionality with 2
threads and basic synchronization.

Signed-off-by: Juan Manuel Torres Palma <0c35d1c59fef8f26e5e6d6b09d287c0255baa1df@gmail.com>

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