Support running tests through valgrind