Addressing the Loss-Metric Mismatch with Adaptive Loss Alignment