[FOLD] Change Session::detach to return shared_ptr