main: more resilient getAverageSegmentSize
swarm: use segment size to set timeouts (close #42)