Sync on lockHash only if we'll log something
Sync on lockHash only if we'll log something

For the default logger level, warn, we'll acquire the lock, hold it,
traverse the in memory cache, never log anything, and finally release
the lock.

Let's only do this when the log level is high enough to print the
status as it will slow other threads by holding the lock.

https://bugzilla.redhat.com/show_bug.cgi?id=1264188

aljesusg/manageiq-gems-pending,rsevilla87/manageiq-gems-pending,rsevilla87/manageiq-gems-pending,aljesusg/manageiq-gems-pending