thread-safe bre_tree disposal