Correctly close SQLite Database

- In the android SQLite database wrapper the close method only closes when the thread calling close is the thread that created the database.
- For JavaSE behaviour is unchanged. Each thread closes connection to the db
- IndexManagerIndexTest now uses datastore.close() to close the db
Yeah, its pretend that we are closed if the current thread called close() on this object. So if the main thread opened the datastore but a worker closed it, the connection would appear closed to the worker, but the main thread would see it as open. I'll add some code comments to explain to the reader :)