Optimal sorting with persistent comparison errors