lavfi: factorize freeing a link