Restoration of the derivative discontinuity in Kohn-Sham density functional theory: an efficient scheme for energy gap correction.