Add a thread-safe fixed-size allocator.

To be used in place of malloc/calloc/free for certain things. To get
malloc/free used again (for debugging), just set it to have zero
buckets.
Pre-calculate spesh-candidate work/env sizes.