I rewatched the three newer movies and noticed that whenever a Jedi was killed, or let go of their lightsaber, it immediately turned off. What was curious was that the lightsaber turns off right away, when a Jedi is killed, even before it leaves their hand (if it does fall out). I could understand if the button needs to be held for it to stay on, but when a Jedi is shot and is still holding the lightsaber why would it turn off?
Most lightsabers have a built-in deadman switch. It would just be irresponsible for a Jedi to construct such a dangerous weapon without one. Essentially, if the handle is not being held (has pressure on it) the weapon deactivates. This prevents a lightsaber from flying away from the disarmed Jedi and scything through his allies (or slashing the viewport of the space station, etc).
When a lightsaber is thrown, the Jedi uses the force to guide it and also keep the switch from closing, deactivating the blade.
Oddly, there's no mention of this in the EU, but it's presence can be clearly seen in the series, as you noted.
I was fairly sure that lightsabers worked with/powered with the force? So when a jedi dies, they obviously aren't able to put force power into the saber. It explains why droids and the like can't use them, too. It also explains how they can be thrown (although I don't think they throw an activated saber in IV, V, or VI)
I think there is some kind of bond with the lightsaber crystal,Jedi,and force so when the Jedi dies the Jedi disappears from the bond so the force can't power the lightsaber and it shuts off or in a one of the movies where earth Vader battles obi won you can see a wire so maybe the wire bends a little and the lightsaber turns off.