avcodec: Do not lock during open for codecs marked as having threadsafe init