avcodec/parser: Make av_register_codec_parser() thread safe