sanitizePath function

Sanitize a file path for the current operating system