Measurement of the ratio of branching fractions ℬ(Bc+→J/ψK+)/ℬ(Bc+→J/ψπ+)