framework/task_manager: Fix memory leak possibility when fail case
framework/task_manager: Fix memory leak possibility when fail case

when fail to alloc, allocated memory should be released before return.

Samsung/TizenRT,pillip8282/TizenRT,an4967/TizenRT,junmin-kim/TizenRT,chanijjani/TizenRT,an4967/TizenRT,JeonginKim/TizenRT,Samsung/TizenRT,jsdosa/TizenRT,jeongchanKim/TizenRT,HONGCHAEHEE/TizenRT,jeongarmy/TizenRT,sunghan-chang/TizenRT,jsdosa/TizenRT,jeongchanKim/TizenRT,chanijjani/TizenRT,an4967/TizenRT,junmin-kim/TizenRT,jeongarmy/TizenRT,JeonginKim/TizenRT,jeongchanKim/TizenRT,an4967/TizenRT,junmin-kim/TizenRT,davidfather/TizenRT,junmin-kim/TizenRT,jeongarmy/TizenRT,chanijjani/TizenRT,jeongchanKim/TizenRT,Samsung/TizenRT,JeonginKim/TizenRT,junmin-kim/TizenRT,chanijjani/TizenRT,sunghan-chang/TizenRT,davidfather/TizenRT,davidfather/TizenRT,pillip8282/TizenRT,jeongarmy/TizenRT,jeongarmy/TizenRT,HONGCHAEHEE/TizenRT,junmin-kim/TizenRT,sunghan-chang/TizenRT,HONGCHAEHEE/TizenRT,jsdosa/TizenRT,davidfather/TizenRT,jsdosa/TizenRT,JeonginKim/TizenRT,Samsung/TizenRT,davidfather/TizenRT,sunghan-chang/TizenRT,HONGCHAEHEE/TizenRT,jeongchanKim/TizenRT,pillip8282/TizenRT,JeonginKim/TizenRT,jeongchanKim/TizenRT,HONGCHAEHEE/TizenRT,jsdosa/TizenRT,Samsung/TizenRT,davidfather/TizenRT,pillip8282/TizenRT,jeongarmy/TizenRT,chanijjani/TizenRT,chanijjani/TizenRT,pillip8282/TizenRT,Samsung/TizenRT,JeonginKim/TizenRT,HONGCHAEHEE/TizenRT,jsdosa/TizenRT,jeongarmy/TizenRT,jsdosa/TizenRT,an4967/TizenRT,Samsung/TizenRT,chanijjani/TizenRT,pillip8282/TizenRT,an4967/TizenRT,sunghan-chang/TizenRT,sunghan-chang/TizenRT,an4967/TizenRT,sunghan-chang/TizenRT,davidfather/TizenRT,jeongchanKim/TizenRT,pillip8282/TizenRT,junmin-kim/TizenRT