Analytical theory of terahertz four‐wave mixing in semiconductor‐laser amplifiers