Enhancement: Fix err when the user share the locked file

Fix unexpected behavior when the user try to share the locked file

https://github.com/owncloud/ocis/pull/6358
https://github.com/owncloud/ocis/issues/6197
