Odd, I seem to find that a P0171 code should be a bank 1 lean condition.
With that code, perhaps you just have a loose vacuum hose. This could explain the missing and might also be a source of the gasoline smell. A dirty MAF sensor could also give you that code, but i'm not sure why it would give a gasoline smell.
I would do a very close inspection of all the hoses in the engine compartment, particularly any going to the intake manifold/system. Make sure none have disconnected and/or cracked open badly. It's also not a bad idea with 100,000 miles on it to clean the MAF sensor in any case. So I would do that and see if it has any impact.
In terms of checking for leaking fuel injectors, the normal way is to test the residual fuel pressure when the engine is shut off, i.e., you attach a fuel pressure gauge to the fuel rail and watch the pressure when the engine is shut off. If it drops too quickly, you have a leaky fuel injector(s), a bad check valve in the fuel pump, or a leak in the fuel lines somewhere.
I do not know of any good way to test for a leaky injector without an appropriate fuel pressure gauge. Perhaps someone else has an idea.