Form safe paths which safe_exec() can handle.

the safe_exec() function breaks the whole script with die() if there are special chars in the command. The command itself can contain user input (paths), so the paths should be cleaned from the special chars, the safe_exec() function filters out.