[server] avoid race-condition in timer events
With a granularity of one second, there's a good chance calling
localtime twice will return the same value. We should consider the
event ready immediately if that happens, not wait one second.
[server/pyro] try to shutdown the repository properly
If RepositoryServer.trigger_events is not called we might miss a
QuitEvent and thus never shutdown the repository and its looping tasks.