NXCM-5310 optimized ResourceMergingConfigurationManager#appendConfig

Replaced nested loop scanning of roles list with more efficient
hash-map lookup. For ~14K roles this results in >50x improvement
of ResourceMergingConfigurationManager#appendConfig (from ~1100ms
to ~20ms) on my hardware. The improved implementation is also
expected to scale better with higher number of roles.

Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
NXCM-5310 optimized MergingConfigurationManager multithreaded perfomance

Before this change the following situation was possible under heavy
multi-threaded load

* dynamic security resource becomes dirty
* very large number of threads will block in
  ResourceMergingConfigurationManager#getConfiguration() waiting on
  synchronized super.clearCache()
* each blocked thread will eventually clear the cache and execute
  CPU expansive super.getConfiguration()

Reworked locking logic to guarantee only one thread recreates security
configuration when dynamic resources become dirty.

Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
Merge pull request #33 from sonatype/NXCM-5310_ResourceMergingConfigurationManager_high_cpu_usage

Nxcm 5310 resource merging configuration manager high cpu usage

Merging changes into branch of "old" structure for release