The amount of gunpowder you could inhale, and still be able to breathe without coughing horribly until it’s all gone, must be quite small. Probably too small to ignite, or at least too small to do much damage if it did.
Not to mention that such gunpowder would probably be spread thinly throughout your lungs, not all concentrated in one place.
Not to mention, also, that such gunpowder in your lungs would, y’know, get wet.
Gunpowder, according to wikipedia, has a flashpoint of approximately 800 degrees Fahrenheit. If any part of your lungs are at 800 degrees, you have vastly more serious problems than the possibility of some gunpowder going poof.