db: rename redeclaration of builtin function __atomic_compare_exchange.

This patch renames the function __atomic_compare_exchange to avoid
conflict with the builtin function of the same name. This is done
to allow db to be built using clang. db builds using gcc without this
patch because this code is enclosed in gcc-specific if-guards.
elfutils: use macro for nested function

Replace the nested function lock_dup_elf with a macro to avoid
compiler errors with clang. This works in gcc because gcc supports
nested functions but clang does not.