fix sharing update, add proper escaping

fix for https://github.com/owncloud/core/issues/9863

cc @PVince81 @DeepDiver1975 @LukasReschke @craigpg @karlitschek 
@bantu previous unit tests failed because of quoting the permissions. That's why I removed it again and as said this shouldn't be a problem. The permission always comes directly from the db and the db can only store a integer in this field.