avoid pathname being null

require('url').parse('ssh://xxx') -> { pathname: null }, then obj.pathname.replace will get error
Merge pull request #1 from afc163/patch-1

avoid pathname being null