On the origin of molecular cloud rings in spiral galaxies - CO observations of NGC 7331 and NGC 2841