Competitive interactions in carboxy-functionalized pyridinium salts: crossover from O-H center dot center dot center dot O to O-H center dot center dot center dot X-M contacts