Fix some problems with the bug9002 fix.

Fixes bug 9090; bug not in any released Tor.
Merge remote-tracking branch 'origin/maint-0.2.3' into maint-0.2.4
Merge remote-tracking branch 'origin/maint-0.2.4'