Spatiotemporal shaping of half-cycle terahertz pulses by diffraction through conductive apertures of finite thickness