First-principles calculation of defect formation energies and electronic properties in stannate pyrochlores