Add memory leak detection to d2i_test