To my knowledge, you generally didn't find safety valves on lower pressure steam locomotives. Basic physics, most air pumps weren't designed to create an air pressure output greater than the steam pressure being input. Not sure what they did on higher steam pressure engines.
With diesels, you will find one to three safety valves on the air system. A main reservoir safety, usually one on the intercooler, and often one of the air compressor discharge pipe. It isn't that unusual for them to have to relieve excess pressure in some circumstances (loss of the control circuit or failure of the compressor control/unloader system).