Lattice density-functional theory of the attractive Hubbard model