Sanitize directory path. Delete trailing "/" if present