[IOT-1625] Fix a logic to terminate CA in case of failure of init
- If CAInitializeMessageHandler() fails, we should call
CATerminateMessageHandler() to terminate the main thread successfully.
- Calling u_arraylist_reserve before creating the thread
Bug: https://jira.iotivity.org/browse/IOT-1625
Change-Id: If291d90bbe69abbf967a7f0014c6e5d44644131d
Signed-off-by: hyuna0213.jo <hyuna0213.jo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/14941
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Dave Thaler <dthaler@microsoft.com>
Reviewed-by: Jaewook Jung <jw0213.jung@samsung.com>
Reviewed-by: Jaehong Jo <jaehong.jo@samsung.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/15327
Reviewed-by: jihwan seo <jihwan.seo@samsung.com>