Move the PoolHasRange test to pool.c so that all frees (including internal ones) get the check.