Check for overflow when converting integer to cons and back.