avformat/concat: check the terminating character returned by av_get_token()