Clarify the logic for using the preamble (and overriding the main file
buffer) in ASTUnit::CodeComplete by factoring out a couple of lambdas
(getUniqueID and hasSameUniqueID). While refactoring the logic,
hoist the check for Line > 1 and locally check if the filenames are
equal (both to avoid unnecessary stat calls) and skip copying out the
filenames to std::string.
Besides fewer calls to stat, there's no functionality change here.