Fix source of memory leak in halcmd_main
Fix source of memory leak in halcmd_main

The service_uuid char * is strdup() from the ini file entry string
but this is not freed anywhere.
Add cleanup() function to test and free where appropriate.
Call this function before returns.

Output from valgrind before amendments
==21671== LEAK SUMMARY:
==21671==    definitely lost: 37 bytes in 1 blocks
==21671==    indirectly lost: 0 bytes in 0 blocks
==21671==      possibly lost: 12,657 bytes in 203 blocks
==21671==    still reachable: 76,524 bytes in 413 blocks

Output after amendments
==23009== LEAK SUMMARY:
==23009==    definitely lost: 0 bytes in 0 blocks
==23009==    indirectly lost: 0 bytes in 0 blocks
==23009==      possibly lost: 12,657 bytes in 203 blocks
==23009==    still reachable: 76,524 bytes in 413 blocks

Signed-off-by: Mick <42e9b8d49a07279cb832caaba75ae62c3ee30fbb@mgware.co.uk>

strahlex/machinekit,strahlex/machinekit,strahlex/machinekit,strahlex/machinekit,strahlex/machinekit,strahlex/machinekit,strahlex/machinekit