Quantum annealing with error mitigation