[clang-tidy] Do not crash when an empty directory is used in the comp… (#156873)
…ilation database
Currently a hard crash encourages people to report a bug upstream, but
this is not really a bug. Instead, print an error and use a reasonable
default (the current working directory).
Fixes #57264
Co-authored-by: Carlos Gálvez <carlos.galvez@zenseact.com>