Fix issue with DB upgrade to assignment table

There are two changes:
- Commit changes to the grant tables after each update to ensure MySQL
  doesn't get confused when there are multiple assignments for a given
  actor/target (Postgresql doesn't have this issue)
- Close any sessions in test_sql_upgarde before we call the migrations,
  to ensure table dropping won't be blocked

Fixes bug 1284700

Change-Id: I81704b17ea9c11be926018df125fcfdb79ee6271
Support for mongo as dogpile cache backend.

With this new optional caching backend, MongoDB can be used for caching data.

Change-Id: I25ba1cac9456d5e125a5eac99d42330507d4e329
Blueprint: mongodb-dogpile-caching-backend
Merge "Fix issue with DB upgrade to assignment table"