[SPI-1992]: set VALGRIND_LIB depending where shared objects are

4 jobs for valgrind_lib in 7 minutes and 25 seconds