Fix and improve subtitle extraction

* Fix runtime error when extracting with duplicate = 0
* Only extract subtitles in the allowed language list
* Do not add subtitle language suffix when there is only one subtitle
  (this helps auto-detection of subtitles on many media players)