Add a workaround for Tor issue #9162

This is done by caching the user/orport each time we actually do get
args and then reusing the values when get a new SOCKSv4 CONNECT to the
same host without args (Yes, if the user wants to connect to two separate
Tor instances on the same bridge or other such sillyness, this work around
is insufficient, but I can't do anything about that case).

Also, fixed some minor derp in socks.py, and only write out a id_rsa file
if it's new or changed.