A measurement of the K+K-/pi+pi- ratio from -p annihilation in deuterium and hydrogen gas