Lattice density-functional theory of surface melting: the effect of a square-gradient correction