Add freeArray and use it in HashMap to properly call GC.removeRange. Fixes #591.