Ultra-energetic THz pulses from a laser-driven particle accelerator