Convert TaskRetryOptions to task_retry_limit

Convert TaskRetryOptions to task_retry_limit so that it can be json
encoded and propagated onto the next dict.