lavfi: fix null checking in avfilter_config_links()

Move the first use of `link' after the null pointer check.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
