Black-box inhomogeneous preconditioning for self-consistent field iterations in density functional theory