[ASan] Fix leaks in ASan tests found by LSan