Fix public upload to not close session when encryption is on

The encryption app needs to create keys when uploading files, so the
session needs to be kept open in such case.
Merge pull request #7867 from owncloud/upload-dontclosesessionforencryption

Fix public upload to not close session when encryption is on