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