Thread safety fix -- Make CastorObjects threadsafe.

Apparently this:

https://github.com/vkuznet/cmssw-ib/compare/ThreadSafe_CastorObjects.patch

never made the release. Any reason for that?

@vkuznet @Dr15Jones