net/tls: improve network portability
net/tls: improve network portability

Fix network releated error.
  . resolve build error releated with getaddrinfo and freeaddrinfo
  . store errno before calling fcntl
    (fcntl()->sem_wait() changes an errno to the unexpected value)

Change-Id: Ifa6924a330193dc2fa456ede1779ea9d6cf785ed
Signed-off-by: Junyeon Lee <ddc45265127aa1feb4b01be10ec1f0d25d062d3d@samsung.com>

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