Evolution of structure and superconductivity in Ba(Ni1−xCox)2As2