Avoiding memory leaks in cc_run_dlg-related functions in tools.c

This destroys the dialog widget along with its children.
There was also missing one g_free(), but I don't think the
g_strdup() call was necessary at all, so it's removed.