ASACORE-963 Cleanup AJ globals.

AJ 14.06 uses a number of global pointers (including singletons) that may
point to objects on the process heap. The issue is that the lifetime of these
objects in the heap may be longer than AJ code itself, thus we need to
provide a way to cleanup these global pointers before AJ is unloaded.

Here is the list as reported by Microsoft App Verifier tool:

1. [common\src\string.cc] line 56 - global pointer to an object on the heap
const String* emptyString = new String();

2. [common\src\logger.cc] line 98 - singleton
LoggerSetting* LoggerSetting::singleton

3. [common\os\windows\environ.cc] line 46 - singleton
static Environ* env

4. [common\crypto\cng\cryptoaes.cc] line 48-49 - global BCRYPT handles
static BCRYPT_ALG_HANDLE ecbHandle = 0;
static BCRYPT_ALG_HANDLE ccmHandle = 0;

5. [common\crypto\cng\cryptorsa.cc] line 47 - global BCRYPT handle
static BCRYPT_ALG_HANDLE rsaHandle = 0;

6. [common\crypto\cng\cryptohash.cc] line 42 - global BCRYPT handles
static BCRYPT_ALG_HANDLE algHandles[3][2] = { 0 };

We need to implement functions to clean these globals before unload or
else they could leak resources.

An AJ client that wishes to cleanly unload can call these new Cleanup
functions like so:

...
qcc::cngCache.Cleanup();
qcc::LoggerSetting::Cleanup();
qcc::Environ::Cleanup();

Change-Id: I9e9a1fb4546b115fa41e9285eb2b48896f6e43ce
Signed-off-by: Way Vadhanasin <wayvad@microsoft.com>
Merge "ASACORE-963 Cleanup AJ globals."
ASACORE-1003: Poke pump thread when joining

Change-Id: I798079b03d2b09c8b2a46999183eb680e69305f1
Signed-off-by: Craig Dowell <cdowell@qce.qualcomm.com>
Merge remote-tracking branches 'origin/master' and 'origin/feature/udp_transport' into temp/integration-14.10

Change-Id: If66ddbb1fafdcb3e7d39e86ff3abc6a442e6141f
Signed-off-by: QCE Seabuild <qce.seabuild@qce.qualcomm.com>