avformat/matroskaenc: refactor checks for allowed codecs in WebM