Improve Valgrind instrumentation of memory allocations