avfilter/vf_nnedi: fix memleak at eof and simplify frame handling