netutils/websocket: fix state and loopback bugs
netutils/websocket: fix state and loopback bugs

1. Because of making failure in websocket loopback test,
wrapped gethostbyname() with CONFIG_NET_LOOPBACK definition.

2. Websocket is not clearly changing own's state. So rearrange it.

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

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