Refactor encoding menu creation

* Use of codec MIBs instead of names significantly decreases
  number of iterations
* Remove duplicated codecs
* Fix memory leaks which were caused by wrong parenting and
  empty menus
* Do not add separator if menu is empty
Merge pull request #1432 from trollixx/encoding

Refactor encoding menu creation