Spaces in which compact subsets are closed and the lattice of $T_1$-topologies on a set