Fixed timeline animation

Mostly I fixed broken code in calculating how much time had passed
since our last update.  I also changed the amount that we will adjust
the time to 500ms from 250ms.
2459: Release our lock when we unload the window.

Also refactored the regain lock code.  This cleans up things, and now
we always show an error and quit when we can't regain the lock.