Close session only if encryption app is not enabled

Fixes https://github.com/owncloud/core/issues/12389
Merge pull request #12390 from owncloud/use-session-in-case

Close session only if encryption app is not enabled