Make sure the underlying library context cancellation happens only after the session has been shutdown. Signed-off-by: Luca Bigliardi <shammash@google.com>