Fix a loop closure issue that wrote the last song file over all songs.