rshd: close pam session correctly
When client does not ask for separate error channel rshd will execute
the requested command on top of itself, thus is never able to close
opened pam session. In addition it then closes all file descriptors
except stdin, stdout and stderr. This closing of descriptors will
close descriptor used by pam_systemd module and triggers logind to
kill the process.
Patch contributed by Tom Hughes, <tom@compton.nu>
Resolves RHBZ #896583.
Signed-off-by: Michal Sekletar <msekleta@redhat.com>