physics-bh: use thread local storage for allocation counters

GCC and Clang support it and it works fine. Technically it's in C11, which is the attribute we're using. Anyway, need to figure a way to fairly split octree generation.