avcodec: Do not lock during init if there is no init function