A guess...
I'm thinking that your critter may be some form of weevil larva. As I say, this is just a guess.
Weevils get into dried food stored in our cupboards. I believe they come to us through storage and shipping of dried foods. Flours are known for this. Once in our cupboards, they spread.
Thorough cleaning with heat (steam) is one very good way to eradicate them. I love my hand-held steam cleaning machine for this purpose.
Weevils develop into small moths, I think. I also believe that they don't live within us...wrong environment.
One way to spot weevils is to keep all your dried things in tightly-closed glass containers/bottles. Then, every once in a while, look through the bottom of the jar for 'critter dust'...larva droppings. I believe they can be seen even in flour.
Another sign is fine cobwebs in the top of the container.
A person could boil their bottles to sterilize them, or bake them in a 200 degree oven for a while. Lids may be simmered, too.
Your instinct to clean thoroughly was brilliant, Magma. You are far less likely to have a repeat of the incident. Well done!
F.