Close pipes when freeing config and kill child process on error

When freeing the config, close the pipes corresponding to that
config, so they don't get leaked.  Also, if we have an error,
send a SIGKILL to the child process in case it is blocked and
won't die just because we closed the pipes to it.
1 file changed