Robust Algorithms with Polynomial Loss for Near-unanimity CSPs