avfilter: fix leaks on error in ff_filter_frame