Close indexes database connection in shutdown and dealloc