Move retrying method to separate header in folly/futures