Fix memory leaks from CopyFilter.

RB=257238
R=gogenc,si-dev
A=gogenc