Reinforcement Learning-based Defect Mitigation for Quality Assurance of Additive Manufacturing