avfilter/avfilter: Make avfilter_register() thread safe

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>