tests: fix valgrind tests.