Use freeArray in HashMap destructor

This ensures destructors are called on the elements in the hash map. I'm not sure if this fixes anything but it seemed like it could have caused issues eventually.
Merge pull request #893 from etcimon/patch-1

Use freeArray in HashMap destructor