Thread safe changes
Replace auto ptr with unique_ptr
Fix ptr release
Add missing initialization
Merge pull request #1322 from vkuznet/ThreadSafe_Geometry_CommonDetUnit

Multithreading fixes -- Thread safe changes for Geometry CommonDetUnit