fixed some warnings
handle some shutdown cases and reduce time of locking in octree server