Fixed #12118 - Added ability to share sqlite in-memory database in threa...

Sqlite3 with version >=3.7.13 can share in-memory database between threads.
Built-in sqlite module of python2 comes without ability to specify in-memory database name as URI, but since python3.4 can do this,
So, need to use database name as URI to prevent fails in tests.
I'm returning URI manually, if database name is specified as `:memory:` in settings to give ability to use shared cache without specifying it manually (people will have this after update).
Would be nice to have a helper function like:
```
def is_memory_db(self, name):
   return name == ":memory:" or "mode=memory" in name
```
so we don't have to repeat this logic here and in `creation.py` and `testcases.py`.