The muon anomalous magnetic moment in QED: three-loop electron and tau contributions