I think the origin is Munchkin actually.
Munchkin has a Duck of Doom card, but per a question about it on Board & Card Games SE, linked in a comment by indigochild, there's no real source for the duck of doom joke, other than the legendary sadistic tendencies of certain gamemasters to turn any potential action into a player death. So what would would be the last thing anyone would think of to bring certain dooooooooooom?
A little yellow rubber ducky? Brilliant!
For actual RPGs that are centered around the grim black comedy of death after death, the duck doesn't quite fit. For a tongue-in-cheek game like Munchkin, it fits. So I think that answer (currently top/accepted) referencing Gygax's work is correct, there was no previous origin.
Possibly Munchkin has now been around long enough, and the duck meme-worthy enough, that GMs are now using it as a "fair warning, I need to kill someone now" sign.