Narrow-linewidth ultrabroadband terahertz sources based on difference-frequency generation in mid-infrared quantum cascade lasers