tests: enable leak checking under --valgrind

Since we have squashed all the leaks (or at least the ones that show up
in the test suite), we can now use valgrind to look out for new ones.

One of the reasons for this exercise is the index code, which mixes
recursion with allocating and freeing memory.  Memory leaks may not
cause any problems at run-time - but they're still bugs, and bugs
can make code harder to maintain.
1 file changed