Superheterodyne amplification of optical and terahertz pulses in n-GaN films