lavu: add wrappers for the pthreads mutex API

Also add no-op fallbacks when threading is disabled.

This helps keeping the code clean if Libav is compiled for targets
without threading. Since we assume that no threads of any kind are used
in such configurations, doing nothing is ok by definition.

Based on a patch by wm4 <nfxjfg@googlemail.com>.
Merge commit '2443e522f0059176ff8717c9c753eb6fe7e7bbf1'

* commit '2443e522f0059176ff8717c9c753eb6fe7e7bbf1':
  lavu: add wrappers for the pthreads mutex API

Merged-by: Michael Niedermayer <michaelni@gmx.at>