In-plane anisotropy of the hole g factor in CdTe/(Cd,Mg)Te quantum wells studied by spin-dependent photon echoes