Fix InvalidMemoryOperationError in DebugAllocator

This fixes errors which fail unit tests when using DebugAllocator.
Any reason for the `new`? Couldn't we just use a plain `HashMap` here instead of a pointer?