avformat/matroskaenc: Only change chapter ids if needed.