Stop crashing if LASTDONE exactly equals due time

This caused horrible vim crashes which were very hard to diagnose.
Also adding a test case.