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).
Merge pull request #1848 from owncloud/flock-donottrylockdir

Do not try locking directories