FIX potential overflow in _tree.safe_realloc

The multiplication with the sizeof the base type may overflow, esp.
on 32-bit machines with very large datasets, causing the function to
allocate less memory than was intended, without not raising an exception.