C#: Fix memory leaks produced by GCHandle.Alloc()