NetSafe: Exploring the Topological Safety of Multi-agent Networks