Precision calculation of the pi^- deuteron scattering length and its impact on threshold pi-N scattering