From what I know it's just like when any other pet dies, because I know I've seen dead glitches before. However, I had heard that recently pets have been losing their names immediately upon death due to the PHP update. I haven't heard a final word about whether that's been fixed or not though so I would test it on an unimportant pet first.
Also, since I haven't lost/killed any glitch names before, feel free to keep waiting for an answer while you test the name loss upon death thing, as I can't give you a firsthand answer :)