Why does my 'Caps Lock' diode blink when my system freezes?

This feature is implemented in the kernel. It is not specific to Ubuntu, and has been present since kernel 2.4.19 (what, 2002?). I don't remember what kernel is in raring, but for a modern implementation, see for example https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/input/serio/i8042.c?id=refs/tags/v3.9-rc1#n1032 .

The rationale given in that file:

 * i8042_panic_blink() will turn the keyboard LEDs on or off and is called
 * when kernel panics. Flashing LEDs is useful for users running X who may
 * not see the console and will help distingushing panics from "real"
 * lockups.