Fix: Avoid overwriting the first error set by sem_wait()
Fix: Avoid overwriting the first error set by sem_wait()

Some functions (sem_trywait()) inside wd_delete() may fail and set the
errorno. this would override the any errors set by previous logic.
In recursice  error scenario, catch the first error and set it as errorno

Signed-off-by: pradeep.ns <ce0d81c0e965053a8395391020a8f2fdb9f17a98@samsung.com>

yashwanth686007/TizenRTOS,EunBongSong/TizenRT,jsdosa/TizenRT,junmin-kim/TizenRT,chanijjani/TizenRT,an4967/TizenRT,sangwon03/TizenRT,kimusan/TizenRT,lokeshbv/TizenRT,chanijjani/TizenRT,yashwanth686007/TizenRTOS,Parkjihooni6186/TizenRT,davidfather/TizenRT,Samsung/TizenRT,jeongarmy/TizenRT,jeongarmy/TizenRT,yashwanth686007/TizenRTOS,jeongchanKim/TizenRT,yashwanth686007/TizenRTOS,EunBongSong/TizenRT,youngeunpark/TizenRT,Parkjihooni6186/TizenRT,jeongarmy/TizenRT,heejin-kim/TizenRT,heejin-kim/TizenRT,chanijjani/TizenRT,kimusan/TizenRT,btheosam/TizenRT,chanijjani/TizenRT,btheosam/TizenRT,JeonginKim/TizenRT,davidfather/TizenRT,lssgood/TizenRT,EunBongSong/TizenRT,olegartys/TizenRT,lssgood/TizenRT,jeongchanKim/TizenRT,davidfather/TizenRT,Samsung/TizenRT,youngeunpark/TizenRT,jeongchanKim/TizenRT,shivgarg/TizenRT,jeongarmy/TizenRT,jeongarmy/TizenRT,heejin-kim/TizenRT,sangwon03/TizenRT,olegartys/TizenRT,dr-venkman/TizenRT,manoharahk/TizenRT,jeongchanKim/TizenRT,olegartys/TizenRT,yashwanth686007/TizenRTOS,dr-venkman/TizenRT,dr-venkman/TizenRT,dr-venkman/TizenRT,junmin-kim/TizenRT,heejin-kim/TizenRT,EunBongSong/TizenRT,youngeunpark/TizenRT,youngeunpark/TizenRT,Parkjihooni6186/TizenRT,youngeunpark/TizenRT,JeongJunSik/TizenRT,jsdosa/TizenRT,olegartys/TizenRT,jeongchanKim/TizenRT,btheosam/TizenRT,HONGCHAEHEE/TizenRT,an4967/TizenRT,manoharahk/TizenRT,manoharahk/TizenRT,kimusan/TizenRT,sangwon03/TizenRT,yashwanth686007/TizenRTOS,Samsung/TizenRT,chanijjani/TizenRT,HONGCHAEHEE/TizenRT,lokeshbv/TizenRT,sangwon03/TizenRT,JeongJunSik/TizenRT,junmin-kim/TizenRT,JeonginKim/TizenRT,lokeshbv/TizenRT,pillip8282/TizenRT,pillip8282/TizenRT,davidfather/TizenRT,youngeunpark/TizenRT,Parkjihooni6186/TizenRT,btheosam/TizenRT,JeongJunSik/TizenRT,btheosam/TizenRT,kimusan/TizenRT,kimusan/TizenRT,sunghan-chang/TizenRT,EunBongSong/TizenRT,JeonginKim/TizenRT,JeongJunSik/TizenRT,junmin-kim/TizenRT,sunghan-chang/TizenRT,Samsung/TizenRT,lssgood/TizenRT,an4967/TizenRT,pillip8282/TizenRT,an4967/TizenRT,HONGCHAEHEE/TizenRT,sunghan-chang/TizenRT,lssgood/TizenRT,jsdosa/TizenRT,jeongarmy/TizenRT,JeonginKim/TizenRT,JeongJunSik/TizenRT,Parkjihooni6186/TizenRT,HONGCHAEHEE/TizenRT,junmin-kim/TizenRT,manoharahk/TizenRT,btheosam/TizenRT,jeongchanKim/TizenRT,lssgood/TizenRT,JeonginKim/TizenRT,davidfather/TizenRT,jsdosa/TizenRT,sunghan-chang/TizenRT,sunghan-chang/TizenRT,shivgarg/TizenRT,davidfather/TizenRT,lokeshbv/TizenRT,lssgood/TizenRT,lokeshbv/TizenRT,jsdosa/TizenRT,jeongarmy/TizenRT,dr-venkman/TizenRT,chanijjani/TizenRT,manoharahk/TizenRT,junmin-kim/TizenRT,lokeshbv/TizenRT,sunghan-chang/TizenRT,pillip8282/TizenRT,shivgarg/TizenRT,Samsung/TizenRT,olegartys/TizenRT,HONGCHAEHEE/TizenRT,olegartys/TizenRT,an4967/TizenRT,pillip8282/TizenRT,Samsung/TizenRT,junmin-kim/TizenRT,heejin-kim/TizenRT,shivgarg/TizenRT,dr-venkman/TizenRT,JeonginKim/TizenRT,EunBongSong/TizenRT,shivgarg/TizenRT,chanijjani/TizenRT,Parkjihooni6186/TizenRT,sangwon03/TizenRT,jsdosa/TizenRT,davidfather/TizenRT,jeongchanKim/TizenRT,manoharahk/TizenRT,kimusan/TizenRT,jsdosa/TizenRT,JeongJunSik/TizenRT,heejin-kim/TizenRT,pillip8282/TizenRT,Samsung/TizenRT,an4967/TizenRT,pillip8282/TizenRT,an4967/TizenRT,HONGCHAEHEE/TizenRT,shivgarg/TizenRT,sunghan-chang/TizenRT,sangwon03/TizenRT