bugfix avcodec_open/close
- avcodec_open/close are not thread safe, added global mutex - used for all plugins and recorder.