Don't release the tree read lock in dereference_iter_node()
Previously, the tree read lock could get upgraded in the decrement_reference() and then downgraded back to read lock dereference_iter_node(). This was changed to drop the downgrade to unlock+lock, which allows some delete operations to sneak in and delete node that iterator expect to be in the place.
Expand, the decrement_reference() to indicate if we can upgrade the tree read lock to write lock, and disallow the upgrade if the decrement_reference() is called from the db iterator.
Closes #3645 (closed)