Fix loading of old-style state files with passphrases
Fixup detachment transfers.

1) If a transfer was interrupted then the byte counter wouldn't be
   reset for the new connection, resulting in an error.

2) The transferDetachment function was too large and had lots of
   error handling because it couldn't use defer effectively. By
   splitting the per-connectio code into its own functon, the error
   boilerplate is substantially reduced.

3) Download resumption wasn't previously working correctly. Fixed.

4) The progress bar would tend to get stuck for uploads. It still
   does because Tor seems to have a large buffer which it drains
   completely before accepting new data. But it's a little better
   now.