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.