The Cuntz semigroup of a ring