Fix for DIRMINA-629 : used a lock around all the methods to avoid
concurrent issues. Removed the AtomicXXX which are not anymore useful.