Long-range interaction and induced spin polarization in the spacer of the NiO/Cu/NiFe and NiO/Cr/NiFe trilayers