Only clear the LSM exclusive flag when releasing a tree if it was set, and before decrementing the reference count.