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() or FileWriterDetach() are 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 !  Similar logic dictates
warning for FileWriterDetach(), while I'm at it.
Leak-fix: PromiseIteratorDestroy() neglected the primary allocation.

It tidies away the parts, but forgot to tidy away the container !
Tentative 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.  I'm waiting for
Sigurd's word on how wise this is; but this first draft asserts
everything in the currentfnid, giveargs and currentfncall stacks gets
cleared away when we succeed; and it deletes anything it finds in
those arrays when we fail, clearing the entries to NULL as it goes.