Implement r_file_dirname and support DOS paths in r_file_basename too