trafficserver: Cleanup logging and return codes when detecting it is too late to change headers/status.