Adding a helper to retry an action until a timeout.

Usefull to write tests that wait for something.
I wish there were better closures in python...