[scudo] Fix realloc hooks behavior (#74149)

`realloc` may involve both allocation and deallocation. Given that the
reporting the events is not atomic and which may lead the hook user to a
false case that the double-use pattern happens, we always report the old
pointer is released and report the new allocation afterward (even it's
the same pointer).

This also fixes that we didn't report the new size when it doesn't need
to allocate a new space.

GitOrigin-RevId: 75867f8e4a9a06df3b2cafe662d13ee78bb7fc67
4 files changed