Ensure to not expose the last_query cache

Ensure we do not give out a reference to the internal argument cache of
the compilation database. Instead explicitly copy the internal cache.
The problem with just giving out a reference is that later passes may
modify the argument list. This does not only add unrelated content to
the internal cache, but it also may lead to random crashes in case we
use the argument list from different threads.