Rotate thumbnail when encryption is enabled

When a picture is encrypted, save it to a temporary file first so that
the PHP function for rotation can access it as file.
Merge pull request #8546 from owncloud/fix-preview-orientation-encrypted-master

Rotate thumbnail when encryption is enabled