On a lot of consumer products there's a resettable thermal fuse built into the heating element. Burning down people's houses is bad for business :)
Old fashioned non-automatic electric kettles had such a device that handily pushed out the kettle lead thus disconnecting the mains. I was saved from some embarrasment and redectoration by this a third of a century ago.
PS: how could you detect the presence of water? Photocell? Ultrasound? Conductivity between two small contacts 20% of the way up the jug?