In particularly badly ventilated situations it has been found necessary to provide crews with breathing apparatus - must have been fun driving a steamer wearing that...
http://www.douglas-self.com/MUSEUM/LOCOLOCO/sp4882/sp4882.htm
Something similar was tried on the Garratt Worsborough banker but apparently the crews preferred to suffocate rather than breathe through something someone else had breathed through!
I think pretty much every collection of reminiscences of steam drivers/firemen that I have read includes at least one episode involving a clapped-out, overloaded loco struggling up a bank in a tunnel at walking pace with the crew wondering whether they would make it out the other end before they collapsed, and terrified in case they stalled. In some cases one or other of them did collapse.
Carbon monoxide isn't the only problem. Sulphur dioxide is also significant. There is a fair bit of sulphur in coal, and unlike carbon mon which has an insidious effect, sulphur dioxide is readily detectable and produces a choking effect. Also there is plain old smoke, of course, and simple exhaustion of available oxygen by the fire.
Then, too, there were the occasions when a pilot locomotive was attached to help a train up a bank in tunnel and the crew of the train engine would use this as an opportunity to take it easy for a bit and let the crew of the pilot do all the work. To which the pilot crew might respond by finding a suitable piece of red hot metal and widdling on it, so the train engine driver would open it right up to try and get out of the stench as fast as possible