[encryption] check if file exists (OC6)

backport of https://github.com/owncloud/core/pull/9240

should fix #9191