sourcescanner: Avoid scanning files when doing a macro scan

We already know the condition will be TRUE.
sourcescanner: Do some fast path checks on the filename

Going through the VFS layer is substantially slower, so check against
the base filenames first. This speeds things up on case-sensitive
filesystems.