Improve the sqlite driver

remove orphan tags when closing the database ...