matroska: Factor out write_track from mkv_write_tracks