perf tools: Use zfree() where applicable