1) If you pause and restart just before you die, the game would still work for a short time, and you are likely to die and the death will count.
2) If you die, then quickly pause and restart (which makes no sense, and needs you to be really fast, less than half a second), the game would crash as you say.
Thanks for pointing that out, and thank you for playing <3