Merge "session: Fix a use-after-free bug." into rvc-dev