fix race condition error

When the worker exited the tempfile is not available anymore so we can't
get the last update and calculate the dynamic timeout introduced in
d76bab4d716fed3f965fbde4ba1a1bba975f03d1 .

This changes fix it by catching the IO error.

fix #863
only get last update of the worker once when checking oldest

spotted by @tilgovi, a race condition is possible when making 2
consecutive calls to the last_update function, so only get it once.
Merge pull request #865 from benoitc/fix/863

fix race condition error