Close the database