Do not try locking directories

Some operations like $storage->rename() can replace a target folder with
a source folder. In such cases, the flock app must not try and lock the
folder (only file locking is supported anyway).

Please review @icewind1991 @DeepDiver1975 

Fixes https://github.com/owncloud/core/issues/9099 where the encryption app tries to replace an internal folder with another one using `$storage->rename()`