Fixing LocalExec in cf-execd-runner.c

The premature return was only doing most of the tidy-up needed, so
make it a break instead and add a flag for whether the command
actually completed; use that to condition the one Log() after the loop
that wasn't appropriate to run after this failure.  The alternate
branch to that return's if was in fact the only path out of the loop
for which the Log() was relevant, so made it set the flag for that
Log().  Made the Log() say something sensible as an alternative when
the work isn't complete.  Simplified the code to detect a non-blank
string.

Code skipping spaces at the start of a string could be simplified to
avoid the need for a bool flag to say whether we found anything else.
Kill some stray apostrophes.

Some function names were formatted using '%s'' with two dangling
apostrophes; there should only be one before and one after !
Also: split a long line, purged dangling hspace, added braces demanded
by coding style.
Leak-fixes and clean-up in FnCallPackagesMatching().

Move computation of regex outside the loop - no need to recompute the
same regex for every line of the CSV file ! - and pre-compile it so
that we can search using it more efficiently.  Localise all the
variables related to that at the same time.

Split up various long lines, notably when Log()ging failure to open
the inventory.

Move creation of some objects to where they're needed, to save the
need to tidy them away on failure in the interval.

Don't leak the allocated line when it doesn't match our expectations.

Restructure the for(;;) loop as a while with assignment in its
condition so as to move the failure-handling out of the loop and avoid
duplication of clean-up code.  Reviewed the error message on that
failure: it claimed fread() was involved, which is a lie, so re-worked
it.
Petty leak-fix: close socket on which we failed to listen.

About to exit with error anyway, so not crucial.
Tidy up in SocketConnect().

PR #1952 added an ap = ap->ai_next in an if branch that duplicated one
in its else; replacing these with one after the whole branch put the
loop in the form of a for() unrolled as a while, so I rolled it up as
a for().

If an iteration of the loop managed to create a socket but failed to
connect it, we were leaking it (unless it happened to be the last time
round the loop); the "on failure close the socket" was after the loop,
where it belonged inside.  Further, the Log()ging of that tried to use
GetErrorStr() when enough other functions had been called since the
error that the error string might easily be from something unrelated
to the connection failure.  So Log() before closing the socket in the
loop and don't try to include an error string with the final "none of
it worked" Log().

Tweaked a couple of other Log() messages.
Don't leak return from logging hook function.
UMR-fix: EvalContext's ->pass was unset by default.

There's logging code (PromiseBanner) that reports the pass and
valgrind reported it as an uninitialized memory read.  So change
EvalContextNew() to use calloc and ditch a bunch of initializations
to NULL and false that this does for us.
Merge pull request #1964 from ediosyncratic/leak-fixes

A few leak fixes