Defect evolution and mitigation in metal extrusion additive manufacturing