Mechanisms of incorporation of donor and acceptor dopants in (Hg,Cd)Te alloys