Handle OS-specific path delimiters, and append a trailing delimiter if none is provided on the path variable.