util: add ConfigSource in constructor of BusModule

This is useful for tests to override properties without having to
override System-wide properties.

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
util: add ConfigSource in constructor of CacheModule

This is useful for tests to override properties without having to
override System-wide properties.

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
util: fix race condition in PersistentQueueBase

On shutdown, make sure to decrement the number of active threads before
calling notify(). Otherwise, we may end up with the following scenario:

    Thread A             Thread B

                         curActiveThreads > 0 == true
                         wait(1000)
    notify
                         curActiveThreads > 0 == true
                         wait(1000)
    curActiveThreads--
                         wait timeout
                         curActiveThreads > 0 == false

This change speeds up account tests by 25s (from 1m10s down to
45s).

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>