Handle SSH failures when creating remote tmpdir

Bail out if the SSH command fails rather than continuing with an
empty tmp variable.
More informative error message on failure to resolve tmpdir
Slight style preferences.