Fixes invisible entities and monsters ignoring the player on big/complex
maps, and undefined behaviour (reading past the end of the buffer).
Fixes https://gitlab.com/xonotic/darkplaces/-/issues/322
Adds Mem_Size() for retrieving the size of an allocation.
Simplifies some checks (we can check the pointer now so we dont need to
store byte counts just to see if there's any data).