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

See #1443.