Electrostatic condition for the termination of the opposite face of the slab in density functional theory simulations of semiconductor surfaces