Magnetic properties of the ternary carbides Tm2Fe17Cx