Remove use of AtomicLong and make thread-safe

Place a lock around the merge operation to ensure the merge
operation is thread-safe. Use a java.util.concurrent.ConcurrentHashMap
as the backing store to make get/put threadsafe