Don't get stuck with an invalid cached token

This is an issue introduced in 0.24. If the cached token is invalid
the server won't ask for a new one until the cache expires.
ready for release 0.24.2