Constraining the high-density behavior of the nuclear equation of state from strangeness production in heavy-ion collisions