Enable Valgrind memory leak checking

Also fix some minor test-specific leaks in TestFile.
Test QuestionDispatch and fix bug on error

If an error was reported through AnswerContext,
QuestionDispatch would try to write a NULL answer to the
database.
Rewrite ProcessLoop into ProcessManager

This patch rewrites the ProcessLoop interface an
implementation.

ProcessLoop managed the process event loop for you.  It
required multiple threads to use properly and was unsafe in
various cases (especially error conditions).

ProcessManager lets the caller control the event loop,
allowing single-threaded use.  This simplifies the
implementation at the cost of more complicated usage code.

ProcessManager also lets the caller create the process.
This means the caller is not limited by the capabilities of
the ProcessManager interface.  ProcessLoop was in complete
control of spawning child processes, meaning you could not
(for example) set environment variables in the child process
without changes to ProcessLoop.