MediaLibrary: Close the DB connection when destroying ML instance