we can only close the session if encryption is not used

fixes https://github.com/owncloud/core/issues/10236

@karlitschek @craigpg stable7 backport required - THX