Only retry twice for csrf token error

- This prevents looping forever in the case where for example cookies
  are dissabled.