Insect in a Pistachio.

So I'm minding my own business eating some pistachios, and reading some news sites, and as I crack open the 50th or 60th one, I feel the halves of the shell being held together by something.  It sorta felt like a spider web.  I look down, and I discover that the nut itself has been partially hollowed out, and there's some sort of creature in a cocoon inside the hollow space.

I used another shell-half to poke it out of the spider-webby cocoon stuff.  I have no idea what it is.  It's small and brown and about 3/8 of an inch long.  It's very cylindrical; it looks like it might have wings that are wrapped around itself.

Mmmm, pistachios.