WeakNode permits upgrade_and_downcast_node below which only tries to upgrade if we know the
downcast will work. This makes for a simpler and more performant implementation of FileIter
which would otherwise have to jump through some hoops to drop the reference count whilst not
holding locks if the downcast fails.