Leak-fix: EvalTokenAsClass should destroy its ref even when answering no.
Leak-fix: GenericAgentDiscoverContext()'s existing_policy_server.

SetPolicyServer() takes a copy, so its caller is responsible for
disposing of the original, which ReadPolicyServerFile() built for it.
Leak-fix: Apoptosis leaked its list of owners.
Leak-fix: use WriteClose() to tidy up.

Calling StringWriterClose() and ignoring the return is always a leak.
Warn if StringWriterClose() return is ignored (hence leaked).

Last leak-fix shows that someone clearly thinks StringWriterClose() is
a good way to close a StringWriter - perhaps not the best choice of
function name, given that this is wrong ! - when actually it's a way
to extract its final value (while closing it).  Therefore callers must
in fact do something with that value - if they ignore the return, they
definitely don't free() it like they should !

I tried doing similar for FileWriterDetach() - but FileWriter(stdout)
and even FileWriter(fd) are commonly used, by callers who have no
business closing stdout or fd; FileWriterDetach() is then the sensible
and proper way to let go after using the Writer.
Leak-fix: PromiseIteratorDestroy() neglected the primary allocation.

It tidies away the parts, but forgot to tidy away the container !
Leak-fix: parser objects were getting leaked.

The parser appears to be quite careful about moving off the fragments
it parses into structures, clearing each fragment once it's found a
home; but valgrind reports some leaks, which I conjecture arise when
the paser barfs on bad input and doesn't tidy away all of the
fragments it had in the air when it hit that.  Sigurd confirms that
this is plausible.  The approach here is a bit defensive: it deletes
anything it finds in the currentfnid, giveargs and currentfncall
stacks when we fail, clearing the entries to NULL as it goes; and
asserts they are NULL when we succeed.

Clear currentfncall entry after deleting it (prevents the foregoing
from turning into a double-free) or handing it off to P.rval (which
now owns it, so the foregoing needs to not delete it).
Simplifications in verify_classes.c

Some convoluted decision-making code could be replaced by simple use
of (non-trivial) boolean expressions.  Made a few variables more local
than they were.  Commented on a Log() where ProgrammingError() might
be more apt.
Merge remote-tracking branch 'eddy/leak-hunt'