Fix zero size files on upload

When checking is_dir() whenever a file is being uploaded, the file's
size will initially be zero when requesting a lock. is_dir() will
internally populate the stat cache with that zero size, which cause
subsequent calles to file_size to return zero instead of the real size,
even after the file contents is there.

This fix clears the stat cache after the is_dir() call to make sure the
newly read values are the correct ones, not the cached ones.
Merge pull request #1860 from owncloud/filelock-statcachezerosizefix

[master] Fix zero size files on upload