avcodec: Allow locking and unlocking an avformat specific mutex