Refactored valgrind execution in CI build.