Characterizing Jacobians via flexes of the Kummer variety