Homestyx hydra

R1:0db6eaca4173

Consolidate handling of SSH usernames

Summary:
Ref T4292. This consolidates code for figuring out which user we should connect to hosts with.

Also narrows a lock window.

Test Plan: Browsed Diffusion, pulled and pushed through an SSH proxy.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T4292

Differential Revision: https://secure.phabricator.com/D15754
Repository: R1 hydra
Commit Date: Apr 19 2016