Switching from pyroelectric to ferroelectric order in Ni doped CaBaCo4O7