mono: memory leak fixes
Merged from upstream