find_last_path_separator returns NULL if the filename doesn't contain a path separator in it - i.e., it's just a local file. So protect the loop to avoid a segfault

cmr=v1.8.3:reviewer=rolfv
Bring over changes to MXM from pmix branch:

MTL MXM: establish endpoint connection on the first communication when direct_modex used