test: improve detection of installed Valgrind package version

Also restore vmem_valgrind/TEST4.