Fix 3 test-only leaks found by LSan.