Tunable terahertz-frequency resonances and negative dynamic conductivity of two-dimensional electrons in group-III nitrides