msi: Refactor freeing the import sql strings.