fix safe_windows_dirname