Ensure the KML file is closed on application exit.