The average analytic rank of elliptic curves with prescribed torsion