Convergence rates for empirical barycenters in metric spaces: curvature, convexity and extendable geodesics