Coverity issues bug fixes

:Release Notes:
Coverity issues bug fixes

:Detailed Notes:
Added NULL error check before memory free.
Dynamic allocation of ContextsInfo_t and
ParsedMsg structures to avoid memory allocation on stack.

:Testing Performed:
Compiled locally and tested on official build.

:QA Notes:

:Issues Addressed:
[GF-37394] pmlogctl: coverity issues
Open-webOS-DCO-1.0-Signed-off-by: ashish.sadre <ashish.sadre@lge.com>

Change-Id: If4c9e15819b9ead2177774efaec0981dd81f2577
Reviewed-on: https://g2g.palm.com/3383
Reviewed-by: Build Verification
Reviewed-by: Ashish Sadre <ashish.sadre@lge.com>
Tested-by: Ashish Sadre <ashish.sadre@lge.com>
Reviewed-by: Keith Derrick <keith.derrick@lge.com>