Handle SSH failures when creating remote tmpdir

Bail out if the SSH command fails rather than continuing with an empty tmp variable. Without error checking, an (e.g.) SSH timeout will result in a temporary directory of '/' being set, and module files are then written directly under /, which is Bad and can break other tools; instead should fail fast with an informative error message. 

Pull request for the release branch as this looks like a bug to me, but let me know if it'd be more suitable for devel.