Guard against multiple loads
Revamp cscope database file loading mechanism

Use autocmd to to find the cscope.out database for the file in the
current buffer. Either use the database set by the CSCOPE_OUT
environment variable, or try to find it by iterating up from the file's
directory to the VFS root. Use the first one that we find. Also make sure
that we do not load the same database twice.

Unfortunately it is necessary to change the current directory to the
directory where the cscope.out database resides to maintain correct file
paths for the tags in it. Therefore we need to chdir whenever the visible
buffer changes.

This rewrite maintains the old loading behavior if autocmd is not available.