retryFunc = async(func, args, options) => {
  let currentTry = 0, result;
  while (currentTry <= options.maxRetries) {
    try {
      result = await func(...args);
      break;
    } catch (err) {
      if (err instanceof UnrecoverableError ||
        (err instanceof miniget.MinigetError && err.statusCode < 500) || currentTry >= options.maxRetries) {
        throw err;
      }
      let wait = Math.min(++currentTry * options.backoff.inc, options.backoff.max);
      await new Promise(resolve => setTimeout(resolve, wait));
    }
  }
  return result;
}
Given a function, calls it with `args` until it's successful,
or until it encounters an unrecoverable error.
Currently, any error from miniget is considered unrecoverable. Errors such as
too many redirects, invalid URL, status code 404, status code 502.

@param {Function} func
@param {Array.<Object>} args
@param {Object} options
@param {number} options.maxRetries
@param {Object} options.backoff
@param {number} options.backoff.inc