directory-files cleanup and speed tweaking

* src/dired.c (directory_files_internal):
Check ‘match’ before doing anything heavyweight.
Move decls closer to use.
Remove obsolete comments about GC.
No need to encode ‘directory’ or to call multibyte_chars_in_text.
Remove no-longer-needed bug check.
Skip finalname construction if file_attributes fails.
1 job for master in 90 minutes and 3 seconds (queued for 3 seconds)
Status Job ID Name Coverage
  Test
failed #3316
test-all

01:30:03

 
Name Stage Failure
failed
test-all Test The script exceeded the maximum execution time set for the job
  ELC      mail/yenc.elc
ELC mh-e/mh-alias.elc
ELC mh-e/mh-buffers.elc
ELC mh-e/mh-comp.elc
ELC mh-e/mh-compat.elc
ELC mh-e/mh-e.elc
ELC mh-e/mh-folder.elc
Pulling docker image gitlab/gitlab-runner-helper:x86_64-d0b76032 ...
ERROR: Job failed: execution took longer than 1h30m0s seconds