[MONDRIAN-1726]  Possible deadlock when number of batches exceeds available connections in the pool

Deadlock could occur if a cardinality query occurred on the actor thread when all db connections were consumed.  See the details of MONDRIAN-1726 for details about
the exact scenario.

This change forces cardinality values to be loaded before issuing a LoadBatchCommand, avoiding the risk of a query happening on the thread.  The down side of this approach
 is that cardinality checks are performed even in some cases where they wouldn't be necessary.  MONDRIAN-1801 is intended to come up with a better solution for Mondrian 4.
(cherry picked from commit 5a81dc3)
[MONDRIAN-1726]  Eliminated RolapUtil.Semaphore in favor of java.util.concurrent.Semaphore.  Our home-rolled version had bugs that show up when testing with low QueryLimit values.
(cherry picked from commit a64898c)
[MONDRIAN-1785] Backport of commits 00e3d2bc6c376311ff6b2e5b6628564a45ce233f a3012a4d5e8beb7e7335312f7585cafa72ca4729 75bc4975ffbddb56fbeaab0f36923dd34c76ca1d form master.
(cherry picked from commit 3e11ff5)
Merge pull request #195 from mkambol/cherryPick

[MONDRIAN-1726][MONDRIAN-1785]  Cherry pick of commits from master for SP.