xsortfile: accept sort options
simplify xsortfile usage
add copies of dirname, xmkdir_p
save stat call
re-introduce stat call (in better place?)

since OS just says EEXIST even when it's the wrong type.
create