Rework locations to be a snapshot of malloc state.

This means we keep statistics for allocations on every layer of the stack, but
only the topmost item accumulates entries at a time. Much better book-keeping.

In addition to this, we also do away with the QVector, meaning less chances of
tripping over our own memory management hooking.