Plasma and transit-time mechanisms of the terahertz radiation detection in high-electron-mobility transistors