How to resolve this unmanaged memory leak? - C#