Crystal structure and magnetic properties of titanium-based CuTi2−xMxS4 and CuCr2−xTixSe4 chalcospinels