caos: Make it possible to attach entities to session
caos: Make it possible to attach entities to session

To complement session detachment mechanism, an entity can be attached to
a session, but only if it is in a detached state.  The attachment can
optionally recurse through linked nodes.

edgedb/edgedb,edgedb/edgedb,edgedb/edgedb