avformat: make av_register_*put_format() thread safe