Make sure valgrind is stopped after each test in --enable-valgrind mode, closes #38

This commit uses pgrep + killall (if available) to ensure that valgrind is not
running after each test.