avcodec: add ff_lock/unlock_avcodec functions.