The nuclear equation of state in effective relativistic field theories and pion yields in heavy-ion collisions