Remove trailing slash from $path (trailing slash gets added if using tab completion)