Update add_pathsep() callers.

Have the callers of add_pathsep() store the end pointer,
when appropriate.
Macroize xstpncpy.
improve fname building API.