Improve concurrency with java.util.concurrent.locks.

  - Use AtomicBoolean for shutdown (simplifies a bit of locking).
  - Use Lock instead of synchronized.
  - Use Condition instead of Object.wait() and Object.notifyAll().

git-svn-id: https://svn.apache.org/repos/asf/logging/log4j/log4j2/trunk@1590472 13f79535-47bb-0310-9956-ffa450edef68