retry_times implemented

This function helps to have a retry loop with fixed number of times
instead of timing out using timeout_deferred. This way the work being
done is never cancelled when in progress
shorter - thanks @cyli
Merge pull request #496 from rackerlabs/retry_times

retry_times implemented