avformat/avienc: write last frame duration