Finite-size supercell correction for charged defects at surfaces and interfaces.