magit-locate-emacsclient: deal with invocation-directory being nil

See #1443.
Merge branch 'master' into next

Conflicts:
	magit.el

Only code that no longer exists on 'next' was modified.