The pending edits are stored in the Session object - is it possible your session persists across app restarts?
AFAIK the duplicate key issue relates to the 'key' used internally in the collection of Page Url Objects, not in the database. It shouldn't be possible to get a duplicate key back from the database (because it uses an identity column), so I would expect the problem to be something related to an in-session edit that has caused it.
I know I'm being vague, if you can isolate how you think you caused it I will be able to find it that much quicker.