fix btree iterator resource usage