Probing ultrafast carrier dynamics in semiconductor nanostructures with terahertz pulses