Studies of magnetic interactions in Ni-doped ZnO from first-principles calculations