Fix CSRF checks. Ref owncloud/core#6840