Algorithmic cooling for resolving state preparation and measurement errors in quantum computing