Fix clang warnings and errors in CondFormats/CastorObjects.

Removed unused variables.
Implemented thread-safe deletion.
Modify deletion of atomic contained objects.
Merge pull request #3784 from degano/fix_warn_clang_castorobj_noHeaders_71X

Clang -- Fix clang warnings and errors in CondFormats/CastorObjects.