A walk-free centroid method for lifetime measurements with pulsed beams