Fix bug in log-in fix.

The problem case is logging out, then logging in, but getting the first
log-in attempt *wrong*. Would be good to write a test for this.