Merge pull request #884 from rainers/fix_13111

Fix 13111: GC.realloc returns invalid memory for large reallocation
Merge pull request #889 from MartinNowak/fix13025

fix Issue 13025 - Tools repository does not build on Ubuntu