Properly cleaning up the display tabs v2

This patch properly cleans up the display tabs so that none of the tab
data is being leaked between refresh changes

Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>

v2

Signed-off-by: Joe Konno <joe.konno@intel.com>
Removing a documented memory leak v2

A non-elegant solution to it, but it works well enough to remove the
documented memory leak.  Proves to provide a much larger impact on
memory constrained systems.

v2

Signed-off-by: Joe Konno <joe.konno@intel.com>
Remove another memory leak v2

Pointer gets over written without ever being properly cleaned up.  This
should solve that problem.

v2

Signed-off-by: Joe Konno <joe.konno@intel.com>
Mark pretty_print_init as initialized v2

There is a check for it, but it's never actually set.  Now it's set.

v2

Signed-off-by: Joe Konno <joe.konno@intel.com>
Limit sprintf to buffer size length. v2

Not completely needed, but good practice.  Limiting sprintf to the
length of the buffer size.  This patch not completely necessary as it's
unlikely to be an issue here.

v2

Signed-off-by: Joe Konno <joe.konno@intel.com>
Stop buffer overflow v2

On some builds of Android, we are seeing entries that overrun this
buffer causing some ill-advised effects.  Limiting the buffer copies to
the size of the allocated buffer solves this issue.

v2

Signed-off-by: Joe Konno <joe.konno@intel.com>
Clean up potential buffer issues v2

While no issues have been seen in this section of code yet, it's likely
the same issues that show on the active display will also show on the
report process.

v2

Signed-off-by: Joe Konno <joe.konno@intel.com>
Adding a clean_shutdown function v2

Function is designed to be a on stop place to clean up the entire
application at shutdown time.

v2

Signed-off-by: Joe Konno <joe.konno@intel.com>