Fix key errors in retry process

I believe this is what Simon suggested in https://github.com/dimagi/pillowtop/pull/85#issuecomment-52644396

Hopefully this fixes cases [130258](http://manage.dimagi.com/default.asp?130258) and [130259](http://manage.dimagi.com/default.asp?130259)

@snopoke @czue 
I'm pretty sure this needs to know when a doc is deleted