vmem: fix possible valgrind test match errors and valgrind version check