Energy and spin relaxation of excitons in CdMnTe/CdMgTe quantum wells