physics-bh: fixed lockup in octree generation

I was mislead into thinking that an object was outside the root octree for some reason and that's why the whole generator went berserk. I was wrong, the thing was that the octrees' origin and dimensions did not change. And the cleanup function had a bug causing it to not mark any empty octrees as leafs. And the octree's subcell pointer comparison to null. It all works fine now. Built like a T-34. Still needs tweaks here and there but this marks the end of the tedious octree generator saga.