Ultrafast population dynamics in electrically modulated terahertz quantum cascade lasers