Ion-induced n-p inversion of conductivity in TiNiSn compound for thermoelectric applications