This makes some of the channel related Meterpreter code accessible to
other locations in the framework which enables other sessions to also
support pivoting capabilities.
The rstream is the command shell stream which is not the same as the
underlying network transport. In order for the session's connection
information to be reported properly (as represented by the output of
`sessions`) the SSH connection socket needs to be set as #sock.