Lattice dynamics and negative thermal expansion in the framework compound ZnNi(CN)4 with two-dimensional and three-dimensional local environments