Upon closer inspection, the shutdown script is broken, as the $GNOME_KEYRING_PID variable is interpreted when the cat runs rather than the literal string being inserted. I think escaping the dollar with a backslash is probably necessary to avoid that.