Socket close before returning in examples/artik_demo
Socket close before returning in examples/artik_demo

While returning from the function send_data_to_artik(int *data)

Socket was not closed when connect and tls_init/tls_handshake fails
client_tls was not freed when returning from an error case
Made changes to address above issues.

jeongchanKim/TizenRT,JeonginKim/TizenRT,chanijjani/TizenRT,jeongchanKim/TizenRT,jeongchanKim/TizenRT,JeongJunSik/TizenRT,chanijjani/TizenRT,HONGCHAEHEE/TizenRT,pillip8282/TizenRT,jsdosa/TizenRT,Samsung/TizenRT,Samsung/TizenRT,davidfather/TizenRT,sunghan-chang/TizenRT,sunghan-chang/TizenRT,heejin-kim/TizenRT,heejin-kim/TizenRT,jeongarmy/TizenRT,Samsung/TizenRT,junmin-kim/TizenRT,an4967/TizenRT,JeongJunSik/TizenRT,shivgarg/TizenRT,heejin-kim/TizenRT,shivgarg/TizenRT,davidfather/TizenRT,an4967/TizenRT,Samsung/TizenRT,JeongJunSik/TizenRT,HONGCHAEHEE/TizenRT,jeongchanKim/TizenRT,shivgarg/TizenRT,junmin-kim/TizenRT,chanijjani/TizenRT,an4967/TizenRT,sunghan-chang/TizenRT,btheosam/TizenRT,junmin-kim/TizenRT,lokeshbv/TizenRT,jeongarmy/TizenRT,JeonginKim/TizenRT,an4967/TizenRT,JeonginKim/TizenRT,jeongarmy/TizenRT,davidfather/TizenRT,junmin-kim/TizenRT,shivgarg/TizenRT,lokeshbv/TizenRT,chanijjani/TizenRT,JeongJunSik/TizenRT,jeongchanKim/TizenRT,lokeshbv/TizenRT,btheosam/TizenRT,jsdosa/TizenRT,an4967/TizenRT,davidfather/TizenRT,jeongchanKim/TizenRT,heejin-kim/TizenRT,sunghan-chang/TizenRT,Samsung/TizenRT,pillip8282/TizenRT,JeonginKim/TizenRT,lokeshbv/TizenRT,jeongarmy/TizenRT,an4967/TizenRT,Samsung/TizenRT,davidfather/TizenRT,jsdosa/TizenRT,jeongarmy/TizenRT,chanijjani/TizenRT,HONGCHAEHEE/TizenRT,HONGCHAEHEE/TizenRT,jeongarmy/TizenRT,pillip8282/TizenRT,JeongJunSik/TizenRT,HONGCHAEHEE/TizenRT,sunghan-chang/TizenRT,junmin-kim/TizenRT,JeonginKim/TizenRT,HONGCHAEHEE/TizenRT,JeonginKim/TizenRT,chanijjani/TizenRT,jsdosa/TizenRT,pillip8282/TizenRT,heejin-kim/TizenRT,lokeshbv/TizenRT,jeongarmy/TizenRT,davidfather/TizenRT,pillip8282/TizenRT,btheosam/TizenRT,jsdosa/TizenRT,heejin-kim/TizenRT,lokeshbv/TizenRT,junmin-kim/TizenRT,Samsung/TizenRT,btheosam/TizenRT,jsdosa/TizenRT,pillip8282/TizenRT,btheosam/TizenRT,jeongchanKim/TizenRT,junmin-kim/TizenRT,pillip8282/TizenRT,davidfather/TizenRT,sunghan-chang/TizenRT,shivgarg/TizenRT,JeongJunSik/TizenRT,btheosam/TizenRT,sunghan-chang/TizenRT,shivgarg/TizenRT,chanijjani/TizenRT,jsdosa/TizenRT,an4967/TizenRT